Unanswered: Order by not working with limit/offset clause
We are trying to use offset and limit in db2 SQL to fetch only chunk of records from the table and also trying to retrieve sorted results.
Limit/offset clause is not working with sort clause. Is there a way to resolve this issue?
Select column1, column 2 from table_name
order by column1
Limit 100 offset 0
SELECT name, salary
FROM (SELECT ROW_NUMBER() OVER(ORDER BY salary) AS rn,
WHERE rn BETWEEN 3 AND 5;
3 record(s) selected.