Search Postgresql Archives

ORDER BY col is NULL in UNION causes error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux