2008-09-08 31 views

回答

6

公然改變我的答案。 「極限10」 適用於MySQL和其他人,安格爾使用

Select First 10 * from myTable 

Ref

2

SELECT * FROM myTable的上限10不起作用。在它返回的行數

select * from SomeTable where tid < 2048

的方法有點不準確:

發現了一個可能的解決方案:

 
    TIDs are "tuple identifiers" or row addresses. The TID contains the 
    page number and the index of the offset to the row relative to the 
    page boundary. TIDs are presently implemented as 4-byte integers. 
    The TID uniquely identifies each row in a table. Every row has a 
    TID. The high-order 23 bits of the TID are the page number of the page 
    in which the row occurs. The TID can be addressed in SQL by the name 
    `tid.' 

所以,你可以限制的行數回來使用類似。對我的要求來說很好,但是我只想限制從一個非常大的結果集返回的行以加速測試。

0

嘿克雷格。對不起,我做了一個忍者編輯。 不,極限10不起作用,我誤以爲它是每個人都支持的標準SQL。安格爾使用(根據doc)「第一」來解決這個問題。

0

嘿來自斯德哥爾摩的忍者編輯!不用擔心,已經證實「第一個X」運行良好,比我想出的更好的解決方案。謝謝!