So I came across the following at work, and I can tell right away what it's for but I want to find any documentation for it and can't find anything online!
with details as
(
select *,
row_number() over (order by CREATED_DATE) as [Row]
from
(
select top 10 * from MyTable
) t
)
select *
from details
where [Row] > @lowLimit and [Row] < @highLimit
This looks to me like its for paging functionality. However, I don't know exactly what structure I'm looking at within the sql syntax. Does anyone recognize this syntax and can you point me to where I can read more about it?
Thanks!