From: Brook Milligan <brook@trillium.NMSU.Edu>
To: jas1@scigen.co.uk
Cc: tgl@sss.pgh.pa.us
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Finding the "most recent" rows
Date: Fri, 23 Apr 1999 08:42:55 -0600 (MDT)
Message-ID: <199904231442.IAA17294@trillium.nmsu.edu> (raw)
In-Reply-To: <37204BB5.B6CD57B9@scigen.co.uk>
References: <17966.924794971@sss.pgh.pa.us>
<37204BB5.B6CD57B9@scigen.co.uk>
Tom Lane wrote:
>
> SELECT DISTINCT ON place * FROM table ORDER BY place, time DESC;
>
> might do the right thing. It *seems* to select the first row for each
> value of place. I've never seen a spec for this feature, however, so
> I'm not sure if it's reliable or not...
Cool idea. Is DISTINCT guarranteed to choose the first row that
matches or can it choose any row?
Cheers,
Brook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: brook@trillium.NMSU.Edu, jas1@scigen.co.uk, tgl@sss.pgh.pa.us
Subject: Re: [SQL] Finding the "most recent" rows
In-Reply-To: <199904231442.IAA17294@trillium.nmsu.edu>
References: <17966.924794971@sss.pgh.pa.us> <37204BB5.B6CD57B9@scigen.co.uk> <199904231442.IAA17294@trillium.nmsu.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox