To paginate a select query normally I would do this:
SELECT * FROM items WHERE condition = 1 LIMIT $start, $items
However, in MSSQL there is no LIMIT condition, so I tried with:
SELECT * FROM items WHERE condition = 1 OFFSET $start ROWS FETCH NEXT $items ROWS ONLY
And I get the error:
42000 - [SQL Server]Invalid usage of the option NEXT in the FETCH statement.
So what exactly should I do to paginate results?