Re: Select first ten of each category?

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Select first ten of each category?
Дата
Msg-id F2527281-8EEB-4DD5-8BEC-E5B217549CF2@myrealbox.com
обсуждение исходный текст
Ответ на Re: Select first ten of each category?  (Yanni Chiu <yanni@rogers.com>)
Ответы Re: Select first ten of each category?  (Yanni Chiu <yanni@rogers.com>)
Список pgsql-general
On Apr 13, 2006, at 11:08 , Yanni Chiu wrote:

> Benjamin Smith wrote:
>> It has a LARGE number of entries. I'd like to grab the 10 most
>> expensive items from each category in a single query. How can this
>> be done?
>
> Use a LIMIT on your SELECT. See:
> http://www.postgresql.org/docs/8.1/static/queries-limit.html

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?


Michael Glaesemann
grzm myrealbox com




В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Select first ten of each category?
Следующее
От: "Gregory S. Williamson"
Дата:
Сообщение: Truncate and Foreign Key Constraint question