要统计所有的用户量,从多个表里查询数量,然后进行取和,sql 如下:
select sum(tmpcount) from (
select count(*) as tmpcount from tab1
union all
select count(*) as tmpcount from tab2
) a
要统计所有的用户量,从多个表里查询数量,然后进行取和,sql 如下:
select sum(tmpcount) from (
select count(*) as tmpcount from tab1
union all
select count(*) as tmpcount from tab2
) a