亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如下sql報ORA-00933 命令未正確結束?請問該怎么解決?

如下sql報ORA-00933 命令未正確結束?請問該怎么解決?

慕哥9229398 2022-04-14 15:11:03
update set table1 fir set fir.a=(select name from table2 sec where fir.id_1=sec.id) and fir.b=(select name from table2 sec where fir.id_2=sec.id);想要做此更新多個字段應該如何寫sql?這個sql報ORA-00933 命令未正確結束
查看完整描述

3 回答

?
冉冉說

TA貢獻1877條經驗 獲得超1個贊

實際上是語法錯誤。
同時更新多個字段,不是使用and連接,而是使用','逗號隔開。
所以,你這個語句的正確寫法是,把and改成,
update set table1 fir set fir.a=(select name from table2 sec where fir.id_1=sec.id) , fir.b=(select name from table2 sec where fir.id_2=sec.id);

查看完整回答
反對 回復 2022-04-19
?
qq_花開花謝_0

TA貢獻1835條經驗 獲得超7個贊

update table1 set RYMC = '人員名稱'||rownum;
你這樣試試,執行前備份一下table1里的數據,別不是你想要的結果
如果是全表修改不用加條件,如果不是的全表修改,比如只修改前50條
update table1 set RYMC = '人員名稱'||rownum where rownum<=50;

查看完整回答
反對 回復 2022-04-19
?
尚方寶劍之說

TA貢獻1788條經驗 獲得超4個贊

update set table1 fir
set (
fir.a=(select name from table2 secwhere fir.id_1=sec.id) ,fir.b=(select name from table2 sec where fir.id_2=sec.id)
);

查看完整回答
反對 回復 2022-04-19
  • 3 回答
  • 0 關注
  • 773 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號