日期:2014-05-17 浏览次数:20537 次
update A set A.nowtype = '到期' from A inner join B on A.STUDENTID=B.STUDENTID and B.Isend='到期'
------解决方案--------------------
update A set A.Nowtype='到期' from A join ( select STUDENTID from B group by STUDENTID having count(*)=sum(case when Isend='到期' then 1 else 0 end) ) T on A.STUDENTID=T.STUDENTID
------解决方案--------------------
update a set a.Nowtype='到期' from a , (select STUDENTID from B group by STUDENTID having count(1)=sum(case when Isend='到期' then 1 else 0 end) )b where a.STUDENTID=b.STUDENTID
------解决方案--------------------
update a set Nowtype = '到期' from a where STUDENTID not in
(select distinct STUDENTID from b where B.Isend <> '到期')
------解决方案--------------------