difference when using 'distinct on'

Поиск
Список
Период
Сортировка
От Johnson, Shaunn
Тема difference when using 'distinct on'
Дата
Msg-id 73309C2FDD95D11192E60008C7B1D5BB05FED833@snt452.corp.bcbsm.com
обсуждение исходный текст
Ответы Re: difference when using 'distinct on'
Re: difference when using 'distinct on'
Список pgsql-general

Howdy:

Can someone tell what the difference (and why
you would use it) is between the following:

[snip]
select distinct on (col_1, col_2),
col_1,
col_2,
col_3
from t_table

--

select distinct
col_1,
col_2,
col_3
from t_table
[/snip]

In the first example, is it just getting
the unique rows for the first two columns?

Thanks!

-X

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Between(Interval of two dates) in Postgres
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: psql prompt