With Sybase I do something like this:

set rowcount <startrow + numer of rows wanted>
select id = identity(5), ... into #tmp
from ...
order by ...
select ... from #tmp
where id > startrow

I suspect that you can do something similar with MS-SQL. This works
quite well, although there is some potential contention on tempdb
because of the tempdb system table locking.

I don't know anything about PostgreSQL, though.

Michael

Charles Day writes:
 > Precisely.  We use SQL7/SQL 2000, and PostgreSQL 7.  We can do this on the
 > scripting side, but don't want to fetch all rows each time.   
 > 
 >  
 > 
 > -----Original Message-----
 > From: Michael Peppler [mailto:[EMAIL PROTECTED]]
 > Sent: Thursday, November 29, 2001 4:18 PM
 > To: Sterin, Ilya
 > Cc: Charles Day; '[EMAIL PROTECTED] '
 > Subject: RE: 1-10, 11-20
 > 
 > 
 > I'm guessing the problem is getting the first 10 rows of a query, then
 > rows 11-20, etc.
 > 
 > How you do that depends on the database engine you use, and how the
 > CGI script is implemented...
 > 
 > Michael
 > 

-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com

Reply via email to