清除垃圾数据, 比如用户删除了数据,

DELETE FROM yw2 where pid not in(select id FROM tb2) OR pid is NULL;

原文地址:https://www.cnblogs.com/xiaohouzai/p/7653348.html