How to UPDATE one column using another column in another table? SQL Error: ORA-00933: SQL command not properly ended

前端 未结 4 723
余生分开走
余生分开走 2021-01-17 08:43

I have tried everything I can think of but couldn\'t solve this SQL error:

SQL Error: ORA-00933: SQL command not properly ended

4条回答
  •  遇见更好的自我
    2021-01-17 09:13

    If you want to update rows from a subquery with more than one record you can use the merge commenad:

    merge into SALES_DATA_FAMILY_2007 A
    using (select POG_ID , FAMILY
                     FROM POG_HIERARCHY ) B
    on (A.FAMILY_ID=B.FAMILY)
    when matched then
    update set A.POG_ID=B.POG_ID
    

提交回复
热议问题