LIMIT question

Поиск
Список
Период
Сортировка
От EXT-Rothermel, Peter M
Тема LIMIT question
Дата
Msg-id 8D9E4E8445BD14478121CC9B027B518AC2F806@XCH-NW-11V2.nw.nos.boeing.com
обсуждение исходный текст
Ответы Re: LIMIT question  ("Richard Broersma" <richard.broersma@gmail.com>)
Список pgsql-sql
I need to use a LIMIT count in a query but I also need to know how many
rows the query itself would yield without the limit.
I can do this inside a transaction like this

BEGIN
SELECT COUNT(*) from table1 where blah;
select * from table1 where blah LIMIT 1000;
COMMIT

Now I can give some feedback like your search matches 200,000 but was
limited to 1000 items.
Is there a better way to accomplish this goal?




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Fernando Hevia"
Дата:
Сообщение: Re: Cursor
Следующее
От: "Richard Broersma"
Дата:
Сообщение: Re: LIMIT question