declare @count int
select @count=count(1) from (select a from table
union
select b from table1)c
select @count
select @count=count(1) from (select a from table
union
select b from table1)c
select @count
调试欢乐多
union
select b from table1set @cnt=@@rowcount