Netezza Limit offer with order

In Netezza, if yes:

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

First of all, what is OFFSET 20. And will it give me the first 10 lines specified in the order, or will the order be applied after a random 10 lines? I want to select the first 10 rows of a table as indicated in my order.

+4
source share
1 answer

If your table col1 was a list from 1 to 1000

Limit 10 will return 1-10

Limit 10 OFFSET 20 will return 21-31

Delete Offsetto get only the first 10 lines, and yes, it will process first order by.

+3
source

Source: https://habr.com/ru/post/1524307/


All Articles