Subject Re: [firebird-support] Re: Count over multiple tables
Author Arno Brinkman
Hi,

> >in Firebird 2 I believe you can use derived tables...
> >
> >select count(*) from (select 1 from tbl1 union select 1 from tbl2);
>
> That will, I think, give you the value 2 in all cases.

1, because it is not a UNION ALL :-)
Just change the UNION to UNION ALL and it's ok.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81