delete a.* from building a left join wharf as w on w.id=a.wharf_id where w.user_id = -1
标准SQL delete from building where exists (select id from wharf where id=building.wharf_id and user_id = -1);MySQL 中还可以 DELETE building FROM building, wharf WHERE building.wharf_id=wharf.id AND wharf.user_id=-1;
on w.id=a.wharf_id
where w.user_id = -1
delete from building
where exists (select id from wharf where id=building.wharf_id and user_id = -1);MySQL 中还可以
DELETE building FROM building, wharf WHERE building.wharf_id=wharf.id AND wharf.user_id=-1;