Aug 19, 2002 #1 transparent Programmer Joined Sep 15, 2001 Messages 333 Location GB How do I limit the number of rows returned by a query i.e. return 10 results starting with the 5th (as with mysql's limit 5,10) Cheers
How do I limit the number of rows returned by a query i.e. return 10 results starting with the 5th (as with mysql's limit 5,10) Cheers
Aug 19, 2002 #2 aolb Programmer Joined Apr 16, 2002 Messages 180 Location GB Try select top 10 ..... from etc Upvote 0 Downvote
Aug 19, 2002 #3 dbad IS-IT--Management Joined Jul 29, 2002 Messages 3 Location NZ Presume you're paging? Its not too easy to start from, with a limit without running through a CURSOR, unless you know what the row, or keyed order you're starting from. If you do then you can either select top 10 ... from ... order by 'key' where 'key' > known_value or ; set rowcount 10 select ... from ... order by 'key' where 'key' > known value Other client side alternatives may be a better solution. Upvote 0 Downvote
Presume you're paging? Its not too easy to start from, with a limit without running through a CURSOR, unless you know what the row, or keyed order you're starting from. If you do then you can either select top 10 ... from ... order by 'key' where 'key' > known_value or ; set rowcount 10 select ... from ... order by 'key' where 'key' > known value Other client side alternatives may be a better solution.
Feb 19, 2003 #4 nikhilparchure Programmer Joined Oct 6, 2001 Messages 121 Location AU Set Rowcount @RecordNumber ISQL Query Set Rowcount 0 (Doing This Also important Otherwise All Queries will Return @RecordNumber for U'r Entire Session ) Regards Nikhil Upvote 0 Downvote
Set Rowcount @RecordNumber ISQL Query Set Rowcount 0 (Doing This Also important Otherwise All Queries will Return @RecordNumber for U'r Entire Session ) Regards Nikhil