jet - combine 2 sql select count statements -


i ahave 2 simple count queries:

select count (*) t_object select count (*) t_diagram   

how simplest way combine result (sum)?

use union all 2 different count:

select count (*), 't_object count' t_object union select count (*), 't_diagram count' t_diagram 

to sum of counts, use derived table:

select sum(dt.cnt) (  select count(*) cnt t_object  union  select count(*) cnt t_diagram ) dt 

or, use sub-query:

select count(*) + (select count(*) t_diagram) t_object 

Comments