2016-03-25 58 views
0

我能知道究竟是什麼原因讓我得到命令的錯誤不正確地結束,因爲我不知道在代碼中的錯誤命令無法正常結束錯誤

delete 
    from usernamepassword join faculty_admininfo 
    on (usernamepassword.username = faculty_admininfo.email_address) 
    where faculty_admininfo.employee_id IN ('SCM-021232'); 
+1

,其中甲骨文手冊中你有沒有發現'的join'語法刪除語句? –

回答

0

Oracle不支持JOINDELETE條款。因此,在DELETE中使用JOIN是您的查詢的問題。

您需要更改您的查詢才能使用INEXISTS代替。

您可以使用下面的查詢 -

使用 -

DELETE 
    FROM usernamepassword WHERE username IN 
    (SELECT email_address FROM faculty_admininfo 
    WHERE employee_id IN ('SCM-021232')); 

使用EXISTS -

DELETE 
    FROM usernamepassword unpwd WHERE EXISTS 
    (SELECT 1 FROM faculty_admininfo info 
    WHERE info.email_address = unpwd.username 
    AND info.employee_id IN ('SCM-021232')); 
相關問題