Re: [SQL] Finding the "most recent" rows

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: [SQL] Finding the "most recent" rows
Дата
Msg-id 371FB76C.65A146D7@bigfoot.com
обсуждение исходный текст
Ответ на Re: [SQL] Finding the "most recent" rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [SQL] Finding the "most recent" rows
Список pgsql-sql
Tom Lane wrote:

> SELECT DISTINCT ON place * FROM table ORDER BY place, time DESC;

Clever. But why doesn't this work....

select title, summary, time from story t where time = (select
max(s.time) from story s GROUP BY s.title);               
ERROR:  parser: Subselect has too many or too few fields.


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

Предыдущее
От: "G. Anthony Reina"
Дата:
Сообщение: Re: [SQL] Changing the editor for the \e option
Следующее
От: Paul E Stephens
Дата:
Сообщение: Replacing PREPARE