문제

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