From: hubert depesz lubaczewski <depesz@depesz.com>
To: Claudia Kosny <ckosny@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: fetch first rows of grouped data
Date: Tue, 28 Aug 2007 11:14:21 +0200
Message-ID: <20070828091421.GB19637@depesz.com> (raw)
In-Reply-To: <46D2FD9F.3020000@gmx.net>
References: <46D2FD9F.3020000@gmx.net>
On Mon, Aug 27, 2007 at 06:36:47PM +0200, Claudia Kosny wrote:
> Is there a way to do this with one query?
> I am using PostgreSQL 7.4.
you can try to use "distinct on".
depesz
--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: depesz@depesz.com, ckosny@gmx.net
Subject: Re: fetch first rows of grouped data
In-Reply-To: <20070828091421.GB19637@depesz.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