作业帮 > 英语 > 作业

update (select * from scoreTable as s inner join project as

来源:学生作业帮 编辑:大师作文网作业帮 分类:英语作业 时间:2024/11/20 06:51:09
update (select * from scoreTable as s inner join project as p on p.pid=s.pid ) as w set w.score=1 w
update (select * from scoreTable as s inner join project as p on p.pid=s.pid ) as w
set w.score=1 where w.sid=1 and w.pname='语文'
这个语句有错吗
update (select * from scoreTable as s inner join project as
这样写肯定有问题了因为update只能对物理表进行更新,而现在你是在更新子表,那就肯定有问题.不过按你的意思只要改一下就可以了:
UPDATE SCORETABLE
SET SCORE=1 WHERE SID=1 AND PNAME='语文'
WHERE PID IN(SELECT PID FROM PROJECT)