[导入]案例入厂前和离职后的旷工都清除掉,但无法清除离职前的旷工记录喔20080304

--====下面语句把入厂前的旷工 和 离职后的旷工现象都清除掉了,但是无法清除离职前的旷工记录喔,因为违反逻辑了!-
update rb200802 set rb200802.kgxs=0 from rb200802,
(select * from (select * from (select no,rcrq,lzrq from rs where lzrq is not null or rcrq>='2008-02-01') as #t1 left join (select no as 'no2',kqrq,kgxs from rb200802 where kgxs>0) as #t2 on #t1.no=#t2.no2 and (#t1.lzrq is not null) and (#t2.kqrq is not null)) as #t3 where #t3.kgxs>0 and (#t3.kqrq>=#t3.lzrq or #t3.kqrq<#t3.rcrq)) as #t4  where Rb200802.no=#t4.no and Rb200802.kqrq=#t4.kqrq
--====承上over!-
文章来源:http://bbs.fzonet.com/rcds/ShowPost.asp?ThreadID=1650

posted on 2008-03-04 01:20  梦飞天蝎  阅读(252)  评论(0编辑  收藏  举报

导航