Re: Re: [SQL] oracle rownum equivalent? - Mailing list pgsql-general

From Gunnar R|nning
Subject Re: Re: [SQL] oracle rownum equivalent?
Date
Msg-id x6vgzk1fkc.fsf@thor.candleweb.no
Whole thread Raw
In response to Re: Re: [SQL] oracle rownum equivalent?  ("Cary O'Brien" <cobrien@Radix.Net>)
List pgsql-general
"Cary O'Brien" <cobrien@Radix.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

pgsql-general by date:

Previous
From: Kurt Seel
Date:
Subject: two postgres servers on one machine?
Next
From: Tom Lane
Date:
Subject: Re: Re: [SQL] oracle rownum equivalent?