| От | Tony Marston |
|---|---|
| Тема | GROUP BY does not follow SQL standard |
| Дата | |
| Msg-id | gcl2qq$140b$1@news.hub.org обсуждение исходный текст |
| Ответы |
Re: GROUP BY does not follow SQL standard
|
| Список | pgsql-general |
The Postgresql implementation of GROUP BY does not conform to either the 1999 or 2003 SQL standard. The documentation states that every field in the SELECT list which is not aggregated must be specified in the GROUP BY clause. While this was true in the 1992 standard, in 1999 this was changed to "any non-aggregated column appearing in the SELECT list is functionally dependent upon the GROUP BY clause". In the example both p.name and p.price are functionally dependent on product_id, therefore there is no need for them to be included in the GROUP BY clause. In this respect Postgresql is wrong and MySQL is right. -- Tony Marston http://www.tonymarston.net http://www.radicore.org
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера