Re: difference when using 'distinct on'

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: difference when using 'distinct on'
Дата
Msg-id 20030912160714.GA5956@wolff.to
обсуждение исходный текст
Ответ на difference when using 'distinct on'  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Список pgsql-general
On Fri, Sep 12, 2003 at 09:29:39 -0400,
  "Johnson, Shaunn" <SJohnson6@bcbsm.com> wrote:
>
> In the first example, is it just getting
> the unique rows for the first two columns?

Yes. Normally you would use distinct on in combination with an order by
so that you get the particular unique row you are interested in.
For example if col1 and col2 were an event type and col3 was a timestamp
for the event, you could use distinct on to get the earliest or latest
timestamp for each event type.

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

Предыдущее
От: Andrew Rawnsley
Дата:
Сообщение: Re: State of Beta 2
Следующее
От: Manfred Koizar
Дата:
Сообщение: Re: State of Beta 2