Michael,

I do not believe there is a real equivalent.  SQL Server supports the 
'TOP' statement.  It is like using the one-argument variation of 
MySQL's LIMIT clause.  It looks like:

        SELECT TOP 20 foo FROM BAR

The obvious problem is that this is pretty much useless for 
pagination, since there is no way to specify an offset.

The (clumsy) solution I have used in the past is to move the DB 
pointer to the offset I wanted after the query has returned.  In ASP, 
I use the 'rsObj.move' method.  I'm sure there is a JSP equiv.  Of 
course this means you are selecting all 60k rows, and you need about 
twice as much code, but it works.

One more reason not to use SQL Server...

        - H


>I am used to working in MySQL, and am now working with MS SQLServer :(
>I'm hoping someone else has been in this unfortunate situation 
>before and can help me out.
>I'm looking to do pagination of some resultset in JSP.
>in MySQL I would have used something like:
>
>       SELECT * FROM mytable ORDER BY somedatefield LIMIT 20,30
>
>to get the third page of results with 10 results per page.
>MSSQL offers me NOTHING as kind as LIMIT.
>I have a query that returns ~60,000 results, and I don't want to 
>have to grab them all on each page,
>and then move to the range that I need. 
>
>Thanks for the help,
>
>MIchael


-- 

Harold Paulson                  Sierra Web Design
[EMAIL PROTECTED]           http://www.sierraweb.com
VOICE: 775.833.9500             FAX:   775-201-4458

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to