ORDER BY col is NULL in UNION causes error?

Поиск
Список
Период
Сортировка
От Mike Benoit
Тема ORDER BY col is NULL in UNION causes error?
Дата
Msg-id 1167179943.4732.9.camel@ipso.snappymail.ca
обсуждение исходный текст
Ответы Re: ORDER BY col is NULL in UNION causes error?  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-general
I asked about this on IRC and the helpful people online at the time
didn't seem to have an explanation.

Works
---------------------
select * from income_tax_rate_us order by state is null;

Works
---------------------
select * from income_tax_rate_us UNION select * from income_tax_rate_us
order by state;

Fails
---------------------
select * from income_tax_rate_us UNION select * from income_tax_rate_us
order by state is null;
ERROR:  ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of
the result columns

I'm running: PostgreSQL 8.1.5 on x86_64-mandriva-linux-gnu, compiled by
GCC x86_64-mandriva-linux-gnu-gcc (GCC) 4.1.1 20060724 (prerelease)
(4.1.1-3mdk)


--
Mike Benoit <ipso@snappymail.ca>

Вложения

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

Предыдущее
От: Marc Evans
Дата:
Сообщение: Re: Clustering & Load Balancing & Replication
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: ORDER BY col is NULL in UNION causes error?