摘要:表t1(右),t2(右)如下,结构相同,只是数据有差异,关键字为pid: 现在想要找出不同时存在于两个表的记录,即t1较t2多出的记录,以及t2较t1多出的记录。我们用NOT EXISTS语句。/*in t1 but not in t2*/select *from t1where not exists(select *from t2where t1.pid = t2.pid);结果如下:/*in t2 but not in t1*/select *from t2where not exists(select *from t1where t1.pid = t2.pid);结果如下:题外:如果字段
阅读全文
08 2013 档案