Re: Efficiently obtaining (any) one record per group.

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Efficiently obtaining (any) one record per group.
Дата
Msg-id AANLkTimLuEhDOPC_Z=GMcymasETv5Hmww1=6rRT8-E20@mail.gmail.com
обсуждение исходный текст
Ответ на Efficiently obtaining (any) one record per group.  (Allan Kamau <kamauallan@gmail.com>)
Ответы Re: Efficiently obtaining (any) one record per group.  (Allan Kamau <kamauallan@gmail.com>)
Список pgsql-general
On Sat, Jul 24, 2010 at 12:56 AM, Allan Kamau <kamauallan@gmail.com> wrote:
> Hi all,
>
> I have a large table that contains redundancies as per one field.
>
> I am looking for a way to identify (or extract) a non redundant set of
> rows ( _any_ one record per group) from this table and for each record
> of this "distinct" set of rows, I would like to capture it's other
> fields.

Would "Select distinct on ... " work for you?

http://www.postgresql.org/docs/8.4/static/sql-select.html

search the page for "distinct on".

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

Предыдущее
От: Allan Kamau
Дата:
Сообщение: Efficiently obtaining (any) one record per group.
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Blocked inserts on tables with FK to tables for which UPDATE has been revoked