select top 1 @Is_Finished=9
from tstgts.dbo.HangerInfo
where hanger_id=@chrHanger_Id
and datediff(second,Start_Loading_Time,getdate())<30
and datediff(second,Start_Loading_Time,getdate())>0
select变量赋值后为什么后面还有条件
后面条件是不是多余的
这个的意思是如果满足条件的数据存在,才给变量赋值,否则就是空的。