declare @T table (id int,count1 int,count2 int)
insert into @T
select 1,5,4 union all
select 2,8,9
declare @id int set @id=1
declare @count int,@count2 int
select @count=count1,@count2=count2 from @T where id=@id
select @count,@count2
/*
5 4
*/
------解决方案--------------------