Subject | Re: [firebird-support] Re: Count over multiple tables |
---|---|
Author | Arno Brinkman |
Post date | 2004-12-01T23:59:48Z |
Hi,
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
> >in Firebird 2 I believe you can use derived tables...1, because it is not a UNION ALL :-)
> >
> >select count(*) from (select 1 from tbl1 union select 1 from tbl2);
>
> That will, I think, give you the value 2 in all cases.
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