我只需要在下面添加每个计数的总计,这对我不起作用,我得到“关键字'SELECT'附近的语法不正确。”:
DECLARE @total int
SET @total = Count(some select statement)
@total = @total + Count(some select statement)
@total = @total + Count(some select statement)
@total = @total + Count(some select statement)
.. and so on
-- now return the grand total
select @total
或者,如果您认为有更简单或更有效的方法来做到这一点,我也全神贯注。