Re: [GENERAL] get certain # of recs

2001-09-14 Thread Philip Hallstrom
Take a look at the LIMIT part of the SELECT statement. in your case you'd do: select * from tablename limit 21; ALthough you'll want to use an ORDER BY otherwise you could get different results each time.. -philip On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a c

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Stephan Szabo
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; > > WHAT should 'rownum' be to make this select work... OR is there

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Andrew Gould
You might also want to look at the SQL command CLUSTER, which physically reorders the table rows based upon an existing index. Andrew Gould --- Ian Barwick <[EMAIL PROTECTED]> wrote: > Mike S. Nowostawsky wrote: > > > How can one select only a certain number of > records in Postgres? > > > > I

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Patrik Kudo
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; You could use select * from tablename limit 20 If you need to sort i

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Ian Barwick
Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; > > WHAT should 'rownum' be to make this select work... OR is there a diff > syntax? use