documentation extension request - order with function over aggregated functions
В списке pgsql-docs по дате отправления:
| От | PG Doc comments form |
|---|---|
| Тема | documentation extension request - order with function over aggregated functions |
| Дата | |
| Msg-id | 158080678185.1098.6542165890616974586@wrigleys.postgresql.org обсуждение исходный текст |
| Ответы |
Re: documentation extension request - order with function overaggregated functions
|
| Список | pgsql-docs |
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/9.5/queries-order.html Description: In https://www.postgresql.org/docs/9.5/queries-order.html it is said that the following is intentionally not allowed: ``` SELECT a + b AS sum, c FROM table1 ORDER BY sum + c; -- wrong ``` It took me a while to figure out how to do it properly so I propose to add the following (or similar) info: --- If you need to sort by this kind of expression, you will have to retrieve an extra column with the required computation and use it as a sorting key: ``` SELECT a + b AS sum, c FROM table1, a + b + c AS my sorting_key ORDER BY my_sorting_key; -- correct ```
В списке pgsql-docs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера