| От | hubert depesz lubaczewski |
|---|---|
| Тема | distinct on doesn't fail without order by? why? |
| Дата | |
| Msg-id | 20090518182432.GA9289@depesz.com обсуждение исходный текст |
| Ответы |
Re: distinct on doesn't fail without order by? why?
Re: distinct on doesn't fail without order by? why? |
| Список | pgsql-bugs |
I was under impression that select distinct on (xx) ... will fail if xx doesn't match the left most part of order by. i.e. it requires order by xx, while allowing order by xx, something, else. But it seems you can run the query with no order by clause at all. is it intentional? # select distinct on (x) x, y from test; x | y ---+--- 1 | 2 2 | 3 (2 rows) # select * from test; x | y ---+--- 1 | 2 2 | 3 1 | 4 (3 rows) Best regards, depesz -- Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/ jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера