I come, I see, I conquer

                    —Gaius Julius Caesar

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

08 2013 档案

摘要:表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);结果如下:题外:如果字段 阅读全文
posted @ 2013-08-09 16:34 jcsu 阅读(570) 评论(0) 推荐(0) 编辑