如何使用加入从 table 中删除

How to delete from table with join

我正在尝试从 PAINTING table 中删除,同时加入 MUSEUM table。我是 运行 的查询给我一个错误,提示“ORA-00933:SQL 命令未正确结束”。作为参考,我在下面粘贴了我的查询。

DELETE FROM PAINTING
    INNER JOIN MUSEUM ON PAINTING.Museum_Name = MUSEUM.MuseumName
    WHERE MUSEUM.MuCountry = 'France' OR MUSEUM.MuCountry = 'Spain';

在 Oracle 中,您将使用相关子查询。

delete from painting p
where exists (
    select 1 from museum m where pm.museum_name = m.museum_name and m.mu_country = 'France'
)