Re: fetch first rows of grouped data

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Claudia Kosny <ckosny(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: fetch first rows of grouped data
Date: 2007-08-28 09:14:21
Message-ID: 20070828091421.GB19637@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sebastian Ritter 2007-08-28 11:47:45 Re: Database normalization
Previous Message Richard Huxton 2007-08-28 07:59:38 Re: pg & Delphi