declare @s varchar(20)
set @s=''
select top 1 @s=流向状态 from ZX_Office_KQ_Inf where 工号=@工号 order by 日期 desc print @s
set @s=''
select top 1 @s=流向状态 from ZX_Office_KQ_Inf where 工号=@工号 order by 日期 desc print @s
调试欢乐多
select top 1 @变量=流向状态 from ZX_Office_KQ_Inf
where 工号=@工号
order by 日期 desc