Re: [SQL] Finding the "most recent" rows - Mailing list pgsql-sql

From Chris Bitmead
Subject Re: [SQL] Finding the "most recent" rows
Date
Msg-id 371FB76C.65A146D7@bigfoot.com
Whole thread Raw
In response to Re: [SQL] Finding the "most recent" rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [SQL] Finding the "most recent" rows
List 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 by date:

Previous
From: "G. Anthony Reina"
Date:
Subject: Re: [SQL] Changing the editor for the \e option
Next
From: Paul E Stephens
Date:
Subject: Replacing PREPARE