SQL:在更新
我不能发现我的请求,问题误差内加盟。这里是我的要求和2台:SQL:在更新
UPDATE RESERVATION inner join client on reservation.numcl = client.numcl SET reservation.numcl2 = client.numcl2;
错误:
=> [42000][971] ORA-00971: missing SET keyword
表客户 Client table
预订客户 reservation table
解决办法:
UPDATE RESERVATION SET reservation.numcl2 = (select client.NUMCL2 from CLIENT
where client.NUMCL= RESERVATION.numcl);
回答:
Oracle不支持在update
join
(至少明确地)。你想要做什么的等效是:
UPDATE RESERVATION r SET numcl2 = (select client.NUMCL2
from CLIENT c
where c.NUMCL = r.numcl
)
WHERE EXISTS (SELECT 1 FROM client c WHERE c.NUMCL = r.numcl);
的exists
是很重要的,如果你想处理在没有比赛的案件。
以上是 SQL:在更新 的全部内容, 来源链接: utcz.com/qa/257534.html