怎么不能复制哦。
update a set classroom=1from student_dept a join tblkpi b on b.deptid=a.idwhere (b.ks1 is not null or b.ks1>0) and (b.ks2 is not null or b.ks2>0)and a.classroom=0 and b.year=YEAR(GETDATE()) and b.month=MONTH(GETDATE())-- ms sql
declare @sr1 int ,@ks2 intselect @sr1=sr1 ,@ks2=ks2 from tblkpi nolock where 条件 --如果没有条件的话,需要用到游标if(@sr1 is null or @ks2 > 0)修改student_dept中的classroom=1where classroom=0 并且tblkpi中的deptid=student_dept的id 而且当前系统时间的年份等于tblkpi中的year字段值,月份等于month字段值~~