轉載自: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);