Oracle DELETE sql with JOIN doesn't work

后端 未结 2 1721
孤城傲影
孤城傲影 2021-01-26 03:35

My delete statement returns a 933 error in Oracle, I\'m not sure what is wrong-

DELETE b
from temp a
JOIN
  fact_tab b
on a.col1 = b.col1
and a.col2 = b.col2
and         


        
2条回答
  •  青春惊慌失措
    2021-01-26 04:33

    try this

    DELETE FROM
      fact_tab
    WHERE
      EXISTS
      (
        SELECT
          1
        FROM
          temp
        WHERE
          temp.col1 = fact_tab.col1 AND
          temp.col2 = fact_tab.col2 AND
          temp.col2 = fact_tab.col2
      )
    

提交回复
热议问题