日期:2014-05-17 浏览次数:20528 次
select xx,cc,vv,bb,nn from table A
join ..... B
join ..... C
join ..... D
where ((A.Sign_Man = @curMan )
or ( A.filed IN
(SELECT Stat_No FROM SystemInfo..Info_HR2Stat
WHERE HR_No = @curMan AND State = 1) and A.Sign_Man <> @curMan )
or ((dbo.aFunc(B.CurYear,B.CurMonth,B.Gs_No)=@curMan ) and A.Sign_Man <> @curMan
and A.filed not IN
(SELECT Stat_No FROM C
WHERE HR_No = @curMan AND State = 1)))