Re: ms sql limit equivalence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On 01/23/2003 08:47 PM, Dean Grant wrote:
I am just joining this list so if this has been covered in the past I
apologize.  I am working with MS SQL and would like the functionality that
MySQL's limit function provides.  I understand that MS SQL has no such
command or equivalent. Has someone found a way to use standard (or MS SQL
specific) SQL to achieve the same goal?  I have seen bits and pieces of code
and ideas here and there, but nothing seems to work.  Any advice would be
appreciated.
Since the latest MS SQL versions there is the TOP clause that lets you limit the number of result rows. However it will not skip any initial rows that may not want to retrieve after the first pages.

You may want to check Metabase solution that is based on server side cursors. Instead of executing a query directly it just creates a cursor with a given query and instructs the server to only start sending rows after the first that may be found, if you want to skip any rows of course:

http://www.phpclasses.org/metabase


--

Regards,
Manuel Lemos


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux