| От | Tom Lane |
|---|---|
| Тема | Re: using max() aggregate |
| Дата | |
| Msg-id | 5791.961135553@sss.pgh.pa.us обсуждение |
| Ответ на | using max() aggregate (Louis-David Mitterrand <cunctator@apartia.ch>) |
| Ответы |
Re: using max() aggregate
|
| Список | pgsql-general |
Louis-David Mitterrand <cunctator@apartia.ch> writes:
> I am trying to return the most recently updated record from a table:
> SELECT max(stopdate) FROM auction;
> and this works but only returns the timestamp, however if I try to get
> another column with the aggregate it fails:
Perhaps
select * from auction order by stopdate desc limit 1;
In 7.0 this should even be pretty quick, if you have an index on
stopdate.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера