SQL count 多表总数求和问题
SQLcount多表总数求和问题如:selectcount(*)astfromAselectcount(*)astfromB我想把这两次的结果加起来,怎么办啊?...
SQL count 多表总数求和问题
如:select count(*) as t from A
select count(*) as t from B
我想把这两次的结果加起来,怎么办啊? 展开
如:select count(*) as t from A
select count(*) as t from B
我想把这两次的结果加起来,怎么办啊? 展开
3个回答
展开全部
select sum(b.rowcnt)
from sysobjects a join sysindexes b on a.id=b.id and a.xtype='u' and b.indid<2
where a.name in('A','B')
from sysobjects a join sysindexes b on a.id=b.id and a.xtype='u' and b.indid<2
where a.name in('A','B')
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-07-11
展开全部
select
(select count(*) from bumen)+(select count(*) from mrs) as sum_count
(select count(*) from bumen)+(select count(*) from mrs) as sum_count
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询