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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgreSQL(dot)org>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [SQL] Finding the "most recent" rows
Date: 1999-04-23 16:06:09
Message-ID: 21809.924883569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)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

Yeah, I see it too. This looks like a definite bug to me, but I have
other bugs to squash right now :-(. Anyone else want to jump on this?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message valter 1999-04-23 18:43:01 what are postgresql limits?
Previous Message silvia_brown 1999-04-19 00:45:01 adv: Important Psychic Message For You...

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-04-23 16:29:28 Re: [SQL] Finding the "most recent" rows
Previous Message Justin Long 1999-04-23 15:04:07 Large objects - bug? caveat? feature?