select '表一' t,count(A.id) c from A where ......
union
select '表二' t,count(B.id) c from B where ......
union
select '表三' t,count(C.id) c from C where ......
union
select '表二' t,count(B.id) c from B where ......
union
select '表三' t,count(C.id) c from C where ......
(select count(B.id) from B where ......) +
(select count(C.id) from C where ......)
from dual;
(select count(*) from B where ......) +
(select count(*) from C where ......)
from dual;
union all
select '表二' t,count(B.id) c from B where ......
union all
select '表三' t,count(C.id) c from C where ......否则有同样的记录就只显示一个
(
select count(A.id) cnt from A where ...... A_id,
select count(B.id) cnt from B where ...... B_id,
select count(C.id) cnt from C where ...... C_id
)或者select sum(cnt) from
(
select count(A.id) cnt cnt from A where ......
union all
select count(B.id) cnt cnt from B where ......
union all
select count(C.id) cnt cnt from C where ......
)
(
select count(A.id) cnt cnt from A where ......
union all
select count(B.id) cnt cnt from B where ......
union all
select count(C.id) cnt cnt from C where ......
)
(
select count(A.id) cnt cnt from A where ......
union all
select count(B.id) cnt cnt from B where ......
union all
select count(C.id) cnt cnt from C where ......
)