質問

In Netezza, if I do:

SELECT 
   *
FROM Tbl order by col1 
LIMIT 10 OFFSET 20;

First of all, what is OFFSET 20. And also, will this give me the first 10 rows specified in the order by or will the order by apply after random 10 rows are selected? I wish to select the first 10 rows of the table as specified in my order by.

役に立ちましたか?

解決

If your table col1 was a list from 1 to 1000

Limit 10 would return 1-10

Limit 10 OFFSET 20 would return 21-31

Remove the Offset to get just the first 10 rows and yes it will process the order by first.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top