Re: Re: [SQL] oracle rownum equivalent?

Поиск
Список
Период
Сортировка
От Gunnar R|nning
Тема Re: Re: [SQL] oracle rownum equivalent?
Дата
Msg-id x6vgzk1fkc.fsf@thor.candleweb.no
обсуждение исходный текст
Ответ на Re: Re: [SQL] oracle rownum equivalent?  ("Cary O'Brien" <cobrien@Radix.Net>)
Список 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 по дате отправления:

Предыдущее
От: Kurt Seel
Дата:
Сообщение: two postgres servers on one machine?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [SQL] oracle rownum equivalent?