Subject RE: [firebird-support] more then two unions
Author Thomas Steinmaurer
> But this one doesn't work at least within IBConsole:
>
> select 'ident', count(*) from identtab
> union
> select 'name', count(*) from nametab
> union
> select 'netz', count(*) from netztab ;
>
> Dynamic SQL Error
> SQL error code = -104
> Invalid command
> Data type unknown
> Statement: select 'ident', count(*) from identtab
> union
> select 'name', count(*) from nametab
> union
> select 'netz', count(*) from netztab

Explictely cast the first column with e.g. a VARCHAR(5)


select cast('ident' as varchar(5)), count(*) from identtab
union
select cast('name' as varchar(5)), count(*) from nametab
union
select cast('netz' as varchar(5)), count(*) from netztab ;



Best Regards,
Thomas Steinmaurer

The IB LogManager Product Family
Logging/Auditing Suite for InterBase and Firebird
http://www.iblogmanager.com