想象: t1 = 1 t2 = 3 t3 = 5
我需要在每张桌子上运行单独选择,并以一个数量报告计数,即:
select *
from (select count(*) from t1)
+ (select count(*) from t2)
+ (select count(*) from t3);
我的最终结果应该是= 9
答案 0 :(得分:3)
你很亲密;你可以写:
select (select count(*) from t1)
+ (select count(*) from t2)
+ (select count(*) from t3)
;
答案 1 :(得分:1)
select
(select count(*) from t1)
+ (select count(*) from t2)
+ (select count(*) from t3);