Link to home
Start Free TrialLog in
Avatar of paddycobbett
paddycobbett

asked on

How can i filter on row number? SQL Server

I need to be able to filter on row number, but am confused by the row_number() function which i don't think suits my purporse.

I essentially need to be able to request that i only receive rows 20 to 30 from the result. I know it is possible to request the TOP x number of rows, so there must be some similar support for this. I'm doing this to allow a user to "page" through results based on their parameters, so only need the results that reflect the result page they requested. Can someone add a clause to the attached code to return just the rows from 20 to 30? Or else suggest how they would go about doing this. I'd rather not do this filtering on the programming language level for obvious performance reasons.

Thanks for any comments/suggestions :)


SELECT entry FROM tag_system
WHERE filter='x'
AND ..

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paddycobbett
paddycobbett

ASKER

Spot on. Thanks!