转载自:https://blog.csdn.net/headingalong/article/details/77744755
错误sql
delete
from
company_info
where id NOT in
(SELECT
company_info_ID
FROM
USER);
因为null的原因,导致出现子查询的结果为空。
正确的写法是
-- 清除重复的不可用的公司信息
delete
from
company_info
where id NOT in
(SELECT
company_info_ID
FROM
USER
where company_info_ID is not null);
原文:https://www.cnblogs.com/dlp-527/p/11304923.html