From: Frank Morton <fmorton@base2inc.com>
To: pgsql-sql@postgreSQL.org
Subject: Select Maximum Question
Date: Thu, 12 Aug 1999 10:51:33 -0500
Message-ID: <00ef01bee4da$8d704060$8355e5ce@base2inc.com> (raw)
References: <003401bee4d3$42774e20$0200a8c0@mike>
<37B2E714.DB904C2B@bart.w-wa.pl>
I am a SQL newbie, so hang in there with me.
I have two fields in a table, "filename" and "revision".
The table contains 3 rows where the filename is the same and
revision contains "1" "2" and "3" in each respective row.
It also contains another row for a different filename with
revision set to "1".
I want to do a select which only returns the highest revision
level for each filename, so the select will return two rows,
the first filename with revision = "3" and the second filename
with revision set to "1".
How do I do this? I imagine this is simple, but it is new to me.
Thanks.
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: fmorton@base2inc.com
Subject: Re: Select Maximum Question
In-Reply-To: <00ef01bee4da$8d704060$8355e5ce@base2inc.com>
References: <003401bee4d3$42774e20$0200a8c0@mike> <37B2E714.DB904C2B@bart.w-wa.pl> <00ef01bee4da$8d704060$8355e5ce@base2inc.com>
* 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