开发者

Can any one change this query to delete

select a.courseid from branch b 
    left outer join course a on a.courseid = b.开发者_运维技巧courseid
where a.courseid is NULL

i want to delete that rows which is given by this query


It looks like you want to delete branch records that do not have a courseid in the course table. If that's right, then:

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


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

Is this what You want?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜