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>
Subject: Re: [SQL] Finding the "most recent" rows
Date: 1999-04-23 04:08:23
Message-ID: 20915.924840503@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

regards, tom lane

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Brook Milligan 1999-04-23 04:10:04 Re: [SQL] Finding the "most recent" rows
Previous Message Chris Bitmead 1999-04-23 02:34:34 Re: [SQL] SELECT TOP _x_ ??