问题描述
- SQL Server的update的多个表的更新
-
update Student set Adress='山东省济南市文化路1号院'
where StudentNo='S1201302004'
update Student set GradeId=2
where StudentNo='S1201302005'
update Student set Adress='未知@'
where Adress=null
update Subject set ClassHour=55
where SubjectName='走进JAVA编程世界'
***update Result and Subject set StudentResult=StudentResult+5
where ExamDate='2013-10-18'and StudentResult <60
SubjectName='走进JAVA编程世界'
update Result,Subject set StudentResult=55
where StudentNo='S1201302002' and ExamDate='2013-10-18'and SubjectName='HTML和CSS网页技术'从***那里开始出错
解决方案
update [table_name] set column_name=value;
update 后面不能跟多表的...
解决方案二:
t-sql里面同时只能update一个表,delete也是一样,你可以把结果集算出来再update去
时间: 2024-11-01 01:47:27