From: <dr...@ss...> - 2001-02-07 17:23:05
|
In message <Pin...@ti...>, "Roderick A. Anderson" writes: > On Tue, 6 Feb 2001, Andrew Sharp wrote: > > > if($CONFIG{sqllimit} == 1) { > > # this presuposes a limit statement in postgresql, but > > # I think it has them. If it doesn't it can be coded > > # around anyway. > > PostgreSQL does have the limit clause which I believe is in the SQL92 and > SQL99 standards. It's easy to get into the MySQL (choose your own > database) has this feature or that thingy but for the most part PostgreSQL > follows the standands better than the other databases. > > The problem with the limit statement is it is 'stateless'. It picks > the first 'n' records that meet the rest of the selection criteria. > There is no easy way to remember the current 'n' items at the database > level so the the next SELECT statement can pick the next 'n' items. There is a way to pick the next set. Use the offset keyword. select * from table where criteria offset START limit LENGTH -- -- Drew Sullivan, <dr...@ss...> -- Toronto, Canada, +1-416-512-2311 Copyleft--all rights reversed |