任何人都可以将此查询更改为删除

时间:2011-03-17 18:15:03

标签: sql

select a.courseid from branch b 
    left outer join course a on a.courseid = b.courseid
where a.courseid is NULL

我想删除此查询提供的行

2 个答案:

答案 0 :(得分:2)

看起来您要删除课程表中没有courseid的分支记录。如果那是对的,那么:

delete b
    from branch b 
        left outer join course a
            on a.courseid = b.courseid  
    where a.courseid is NULL

答案 1 :(得分:0)

DELETE a 
FROM branch b 
        left outer join course a
            on a.courseid = b.courseid  
where a.courseid is NULL

这是你想要的吗?