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

前端 未结 4 560
余生分开走
余生分开走 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:22

    UPDATE SALES_DATA_FAMILY_2007 A 
    SET A.POG_ID= (select B.POG_ID 
                     FROM POG_HIERARCHY B  
                    WHERE A.FAMILY_ID=B.FAMILY)
    WHERE A.POG_ID IN (SELECT C.POG_ID FROM POG_HIERARCHY C
                       WHERE A.FAMILY_ID = C.FAMILY);
    

提交回复
热议问题