日期:2014-05-18 浏览次数:20497 次
create table student(id int,[status] int) insert into student values(1,2),(2,1) update s1 set [status]=s2.[status] from student s1 join student s2 on s1.id=s2.id-1
------解决方案--------------------
update s1 set [status]=1 from student s1,student s2 WHERE s1.id=1 AND s2.id=2 AND S2.[status]=1