Re: Select first ten of each category?

From: Yanni Chiu <yanni(at)rogers(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Select first ten of each category?
Date: 2006-04-13 05:31:12
Message-ID: e1knn3$h9j$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Glaesemann wrote:
> Without using UNION, (which would require writing a select statement
> for each category), how would LIMIT allow him to do this for each
> category in a single query?

You're right, it would need a UNION, and a SELECT per category.
So there'd be another SELECT to find all the categories beforehand.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2006-04-13 05:45:47 Re: Truncate and Foreign Key Constraint question
Previous Message Tom Lane 2006-04-13 05:02:00 Re: Truncate and Foreign Key Constraint question