Re: version issue?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: version issue?
Дата
Msg-id 26515.983206268@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: version issue?  ("Dan Wilson" <phpPgAdmin@acucore.com>)
Список pgsql-general
"Dan Wilson" <phpPgAdmin@acucore.com> writes:
> : Possibly some future release will actually do the right thing with ORDER
> : BY of an expression on the output columns, but right now it has to be an
> : output column, period.

> OK... I tried adding UPPER(last_name) to the result column lists of both
> sides of the union and it still gives me the same error.

You have to use the SQL-standard syntax for ORDER BY, ie column name or
number, no shortcuts:

    SELECT ..., UPPER(last_name) AS upper_last_name
    UNION
    SELECT ..., UPPER(last_name) AS upper_last_name
    ORDER BY upper_last_name;

or if you prefer, ORDER BY n where n is the ordinal number of the
column.

            regards, tom lane

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

Предыдущее
От: "Dan Wilson"
Дата:
Сообщение: Re: version issue?
Следующее
От: "Dan Wilson"
Дата:
Сообщение: Re: version issue?