| От | hubert depesz lubaczewski |
|---|---|
| Тема | Re: order by alias - doesn't work sometimes? |
| Дата | |
| Msg-id | aO5wT-h2C5WACgaq@depesz.com обсуждение |
| Ответ на | Re: order by alias - doesn't work sometimes? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-bugs |
On Tue, Oct 14, 2025 at 11:10:31AM -0400, Tom Lane wrote: > ORDER BY output-column-alias is a messy hangover from SQL92. > In later SQL versions, identifiers in ORDER BY have the same > interpretation as in WHERE and other clauses, namely they are > columns sourced by the FROM clause. Supporting both interpretations > makes for a lot of ambiguity, so we only allow the old interpretation > in exactly the case required by SQL92, namely "ORDER BY identifier". > > This is documented ... Well, now I understand this: >> Each expression can be the name or ordinal number of an output column >> (SELECT list item), or it can be an arbitrary expression formed from >> input-column values. better. Thanks. Best regards, depesz
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера