首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

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

2012-02-11 
要统计多张表的总数要怎么做比方说有12张表tab_1(1月份),tab_2(2月份).........tab_12(12月份).selectcoun

要统计多张表的总数要怎么做
比方说有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
)

热点排行