last 25 records from a dataset

Поиск
Список
Период
Сортировка
От Brian Scandale
Тема last 25 records from a dataset
Дата
Msg-id 5.1.0.14.2.20020706163958.05f9d330@mail.attbi.com
обсуждение исходный текст
Ответ на Importing dbf files to postgresql  (John Dougherty <jwd@softcom.net>)
Ответы Re: last 25 records from a dataset  (Jason Friedman <jason@powerpull.net>)
Список pgsql-novice
I am looking for the correct way to retrieve the last 25 records from a dataset without having to first retrieve the
entiredataset to pull out the last 25. 

The potential dataset can be very large... 10,000 records that match the query... yet I only can use the most recent
25.

my first idea is:

SELECT *
FROM table
WHERE thisField=thatValue etc...
ORDER BY table_id DESC
LIMIT 25

But I'm not confident in this and looking for a yeah or nay from a guru or two or three.

Thanks,
Brian




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

Предыдущее
От: Josh Jore
Дата:
Сообщение: Re: Importing dbf files to postgresql
Следующее
От: Jason Friedman
Дата:
Сообщение: Re: last 25 records from a dataset