Subject Re: [ib-support] count records
Author Martijn Tonies

> I need to count records in 2 tables that have a field
> that is '100%' and add the counted records together.
> The tables have no relation.
> It would work like this:
> select count(aktid) from akt
> where akt.avtaldebid = '100%' + select count(kliid)
> from kli where kli.avtaldebid = '100%'

As the tables have no relation, I can't think of a way to
get a single result row except for this:

select (
(select count(aktid) from akt where akt. <whereclause>) +
(select count(kliid) from kli where <whereclause> ) ) as mycount
from rdb$database

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird

Upscene Productions

"This is an object-oriented system.
If we change anything, the users object."