Re: Fetching last n records from Posgresql

Поиск
Список
Период
Сортировка
От Moreno Andreo
Тема Re: Fetching last n records from Posgresql
Дата
Msg-id 56FB9D54.9010008@evolu-s.it
обсуждение исходный текст
Ответ на Re: Fetching last n records from Posgresql  ("Deole, Pushkar (Pushkar)" <pdeole@avaya.com>)
Ответы Re: Fetching last n records from Posgresql
Список pgsql-general
Il 30/03/2016 11:19, Deole, Pushkar (Pushkar) ha scritto:

select * from t order by record_date desc limit 5;

 

this will return the recent 5 records.. what I want is the oldest 5 records (in last 30 days)

so remove "desc", in order to have ascending ordering, thus first 5 records are the five oldest:

select * from t order by record_date limit 5

Cheers
Moreno.-


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