DECLARE @page INT, @size INT;select @page = 300, @size = 10SELECT *FROM gpcomp1.GPCUSTWHERE company like 'a%'ORDER BY CUSTNOOFFSET (@page -1) * @size ROWSFETCH NEXT @size ROWS ONLY;