日期:2014-05-17  浏览次数:20789 次

要统计多张表的总数要怎么做
比方说有12张表   tab_1(1月份),tab_2(2月份).........tab_12(12月份).
select   count(*)   from   tab_1   那怎么把12张表的总数都统计出来,写一条语句!!

------解决方案--------------------
select sum(num) from
(select count(*) as num from tab_1
union all
select count(*) as num from tab_2
..
..
select count(*) as num from tab_12
)