Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.3/8.9.1) with ESMTP id MAA79398; Fri, 23 Apr 1999 12:06:46 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id MAA21811; Fri, 23 Apr 1999 12:06:09 -0400 (EDT) To: Chris Bitmead cc: "pgsql-sql@postgresql.org" , pgsql-hackers@postgreSQL.org Subject: Re: [SQL] Finding the "most recent" rows In-reply-to: Your message of Fri, 23 Apr 1999 04:39:33 +0000 <371FF985.FA06E59B@bigfoot.com> Date: Fri, 23 Apr 1999 12:06:09 -0400 Message-ID: <21809.924883569@sss.pgh.pa.us> From: Tom Lane Chris Bitmead 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