Re: Re: [SQL] oracle rownum equivalent?

From: Gunnar R|nning <gunnar(at)candleweb(dot)no>
To: "Cary O'Brien" <cobrien(at)Radix(dot)Net>
Cc: mikeo(at)spectrumtelecorp(dot)com (mikeo), pgsql-general(at)hub(dot)org
Subject: Re: Re: [SQL] oracle rownum equivalent?
Date: 2000-06-08 13:13:23
Message-ID: x6vgzk1fkc.fsf@thor.candleweb.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

"Cary O'Brien" <cobrien(at)Radix(dot)Net> writes:

> Arrg. That's what I get for emailing late at night without checking
> (my Oracle book is in the office). Where I typed rownum I meant
> rowid. You are 100% correct about rownum. You can use rownum for
> things like
>
> select * from foo where rownum <= 20
>
> Where in postgresql you would say
>
> select * from foo limit 20

Related question: A typical web search interface needs a page based
browsing system where you can list the 10 next matches. Is it possible to
do this in PostgreSQL without retrieving all the rows up to your current
page. I'm thinking of something like :

select * from foo where <some search criteria> and
rownum >= 30 and rownum < 40

Or is this where I should look into using cursors to access
the result set ?

Regards,

Gunnar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kurt Seel 2000-06-08 13:27:56 two postgres servers on one machine?
Previous Message The Hermit Hacker 2000-06-08 12:56:50 Re: FreeBSD PostgreSQL7 port and v7.0.2

Browse pgsql-sql by date

  From Date Subject
Next Message Niall Smart 2000-06-08 13:47:20 ORDER BY in definition of views
Previous Message Michael Ansley 2000-06-08 13:02:18 RE: ORDER BY in definition of views