开发者

Can any one change this query to delete

开发者 https://www.devze.com 2023-02-17 07:06 出处:网络
select a.courseid from branch b left outer join course a on a.courseid = b.开发者_运维技巧courseid
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

精彩评论

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

关注公众号