2013年2月6日

mysql 相反结果集查询

摘要: 今天闲来无事,开始整理数据库记录。想查询一张表中没有被另一张表引用的记录,然后删除之。上网查询的方法为:使用not exists或not in.参考文章:http://wenku.baidu.com/view/fe5f5e0d76c66137ee0619ab.html http://hnwsha.blog.sohu.com/177433557.html文章都总结说,无论大表小表,not exists都比not in 效率高.但是我的测试结果如下:A为大表,B为小表。差距为A表记录172683,B表记录84.select count(*) from A;0.031 sec / 0.000 ... 阅读全文

posted @ 2013-02-06 11:28 longzhao&&dilanlx 阅读(3690) 评论(0) 推荐(0)

导航