如何使用一条sql语句统计行数
本来我是这么写的,自己感觉也不满意
declare @rowCount int,@rowCount1 int ,@rowCount2 int
set @rowCount=0
select @rowCount1=count(*) from elecpolicy where epprodsn = ''
select @rowCount2=count(*) from SonyPolicyRecommend where epprodsn = ''
set @rowCount=@rowCount1+@rowCount2
select @rowCount