Re: SQL query re unions and nulls
Posted in 1997
David Pledger wrote:
>
> Don't know about the odbc solution, but this type of Syntax will work
> for Sybase. Explicitly convert the column to a NULL of the desired type.
>
> select a, b, c, d, convert(int, null)
> from x where ...>
> union
>
> select a, b, c, convert(int, null), d
> from x where...>
Informix does not have the convert() function. It is a non-standard
extension (like most of Sybase). The SQL92 operator is CAST(). SQL92
also allows NULL in the select list, which should work as NULL should
not have any type. We await implementation...
Peter
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
Mail: Peter.Lancashire.PL1@bayer.co.uk
My Internet plumbing does not allow me to mail and post news together.
Sorry.
All opinions are my own and not those of Bayer plc.