Subject | Re: [ib-support] SQL Problem |
---|---|
Author | Paul Beach |
Post date | 2001-08-02T14:25:11Z |
SELECT field X FROM table1
UNION
SELECT NULL X FROM table2
The solution is to cast the values so that the datatypes in both sub-selects
match.
cf.
select pkey PKEY, field1 FIELD from table1
UNION
select pkey PKEY, cast (NULL as CHAR(5)) AS FIELD from table2
Where field1 is a char(5) or whatever in table1
Regards
--
Paul Beach
Main Tel (UK):+44 (0) 1844 354465
Mobile: (UK): +44 (0) 7764 188603
http://www.ibphoenix.com
UNION
SELECT NULL X FROM table2
The solution is to cast the values so that the datatypes in both sub-selects
match.
cf.
select pkey PKEY, field1 FIELD from table1
UNION
select pkey PKEY, cast (NULL as CHAR(5)) AS FIELD from table2
Where field1 is a char(5) or whatever in table1
Regards
--
Paul Beach
Main Tel (UK):+44 (0) 1844 354465
Mobile: (UK): +44 (0) 7764 188603
http://www.ibphoenix.com