Subject | Re: [ib-support] select statement with UNION |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-04-25T16:56:39Z |
At 18:08 25.04.2003 +0200, you wrote:
select LocationId, LocationName from Locations
union
select cast(-5 as Integer) as LocationID, Cast('(new location)' as
VarChar(64)) as LocationName from rdb$database
order by 2;
I don't know if it works, but my guess is that your error is reported due
to you not specifying what kind of datatypes -5 and (new location) are. I
changed to using rdb$database because I assume you only want the latter
part of the union to return one row, whereas your original statement would
have returned one row for every entry in Locations.
HTH,
Set
> select LocationId, LocationName from LocationsTry
> union
> select -5, '(new location)' from Locations
> order by 2;
select LocationId, LocationName from Locations
union
select cast(-5 as Integer) as LocationID, Cast('(new location)' as
VarChar(64)) as LocationName from rdb$database
order by 2;
I don't know if it works, but my guess is that your error is reported due
to you not specifying what kind of datatypes -5 and (new location) are. I
changed to using rdb$database because I assume you only want the latter
part of the union to return one row, whereas your original statement would
have returned one row for every entry in Locations.
HTH,
Set