Re: Limiting the result set

Поиск
Список
Период
Сортировка
Искать
От
Bruno Wolff III
Тема
Re: Limiting the result set
Дата
Msg-id
20020816124022.GA14620@wolff.to
Ответ на
Список
Дерево обсуждения
Forgotten the master password of db thiemo <thiemo@gmx.ch>
Re: Forgotten the master password of db Josh Berkus <josh@agliodbs.com>
Limiting the result set "Rob" <rob@jamwarehouse.com>
Re: Limiting the result set Bruno Wolff III <bruno@wolff.to>
Re: Forgotten the master password of db Tom Lane <tgl@sss.pgh.pa.us>
Re: Forgotten the master password of db thiemo <thiemo@gmx.ch>
On Fri, Aug 16, 2002 at 10:06:23 +0200,
  Rob  wrote:
> 
> Is there any way, IN ONE QUERY, to do this.  So I want to basically return
> the first 500 results
> and a count of the total result set in one go.  Is this possible?
> 
> If not, what would be the quickest way to do this?  The reason I need one
> query is because I use
> dynamic SQL, which complicates stuff a bit more

It is certainly possible to do this, if not efficient.

You can always just union two queries together using an extra column that
is null for the real records and returns the full count in a special
record. Order by can be used to make this record first or last.
В списке pgsql-novice по дате отправления
От: Rob
Дата:
Сообщение: Limiting the result set
От: Mark Nelson
Дата:
Сообщение: Is my database done for?
FAQ