mysql - delete broken records (records not having foreign key id corresponding records)

voted: 1
mysql delete nested subquery

To delete broken records nested subquery must be used, because mysql does not have ability to delete from subquery on the same table.

delete from employee where in(
    select * from(
        select from employee left outer join company on ( = employee.company_id)
        where is null
        order by desc
    ) as 2id
working url: not entered
version: not entered
Leave a Comment:
Characters left:
No comments yet.