sub-limiting a query

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: sub-limiting a query
Date: 2007-02-17 12:56:35
Message-ID: 20070217125634.GA20589@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I've got a table of shows with different types (movie, theater,
ballet,etc.) and I am looking for a select that can return the 10 last
entered shows AND at most 2 of each type. Is that possible in one query?

The table looks basically like:

created_on | timestamp without time zone
show_name | text
id_show | integer
show_type | text
id_show_subtype | integer

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2007-02-17 15:00:33 Re: sub-limiting a query
Previous Message Rajesh Kumar Mallah 2007-02-17 09:32:06 ordering of selected rows from an ordered subselect