fetch first rows of grouped data

From: Claudia Kosny <ckosny(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: fetch first rows of grouped data
Date: 2007-08-27 16:36:47
Message-ID: 46D2FD9F.3020000@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi there

I have a list of events that take place in a certain city at a certain
date. Now I would like to have the first two (ordered by date) events
for each city.

Is there a way to do this with one query?
I am using PostgreSQL 7.4.

Thanks for any tips.

Claudia

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2007-08-27 16:51:02 Re: fetch first rows of grouped data
Previous Message Jean-David Beyer 2007-08-27 15:56:30 Re: Block size with pg_dump?