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 371FF985.FA06E59B@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
Re: [SQL] Finding the "most recent" rows
List pgsql-sql
Tom Lane wrote:
> 
> Chris Bitmead <chris.bitmead@bigfoot.com> writes:
> >>>> select title, summary, time from story t where time = (select
> >>>> max(s.time) from story s GROUP BY s.title);
> 
> > Why doesn't replacing "=" with "IN" produce a result? It wouldn't be the
> > desired result, but I thought this was legal.
> 
> I thought so too (on both counts).  Are you saying it doesn't work?
> What happens?  Which version are you using?

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

I'm using postgresql-snap-990329.tgz


pgsql-sql by date:

Previous
From: Brook Milligan
Date:
Subject: Re: [SQL] Finding the "most recent" rows
Next
From: Julian Scarfe
Date:
Subject: Re: [SQL] Finding the "most recent" rows