i’m looking to get certain sql results from a query depending on where they are positioned, for example, consider this code
SELECT * FROM Product ORDER BY id asc
which could return at least 100 or so results.
the question is though, how can i get the first 1 – 10 results of that, and then in another different, separate query, how can i get the results that are 11 – 20 or even get the results that are positioned 51 – 60 of that query?
There are a number of ways, here’s one approach using ROW_NUMBER: