当前位置: 代码迷 >> Oracle开发 >> 要统计多张表的总数要如何做
  详细解决方案

要统计多张表的总数要如何做

热度:45   发布时间:2016-04-24 07:39:18.0
要统计多张表的总数要怎么做
比方说有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
)
  相关解决方案