Re: the best way to get the first record from each group

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: the best way to get the first record from each group
Дата
Msg-id 20050208011626.GA43996@winnie.fuhr.org
обсуждение исходный текст
Ответ на the best way to get the first record from each group  ("q2005" <q2005@tpg.com.au>)
Список pgsql-sql
On Tue, Feb 08, 2005 at 10:36:17AM +1000, q2005 wrote:
>
> Is there any better alternative to get the first record from each group?

PostgreSQL has a non-standard SELECT DISTINCT ON query for just
this purpose.

http://www.postgresql.org/docs/8.0/static/queries-select-lists.html#QUERIES-DISTINCT
http://www.postgresql.org/docs/8.0/static/sql-select.html#SQL-DISTINCT

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: "q2005"
Дата:
Сообщение: the best way to get the first record from each group
Следующее
От: "Premsun Choltanwanich"
Дата:
Сообщение: Re: How can I use large object on PostgreSQL Linux