Received: from localhost.localdomain (h246.ozemail2.ozemail.com.au [203.108.14.246]) by hub.org (8.9.3/8.9.1) with ESMTP id TAA35005 for ; Thu, 22 Apr 1999 19:56:08 -0400 (EDT) (envelope-from chris.bitmead@bigfoot.com) Received: from bigfoot.com (localhost [127.0.0.1]) by localhost.localdomain (8.8.7/8.8.7) with ESMTP id JAA02941 for ; Fri, 23 Apr 1999 09:57:32 +1000 Sender: chris@localhost.localdomain Message-ID: <371FB76C.65A146D7@bigfoot.com> Date: Thu, 22 Apr 1999 23:57:32 +0000 From: Chris Bitmead X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: Re: [SQL] Finding the "most recent" rows References: <17966.924794971@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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.