Sql(in与exists)

1、如果查询的两表大小相当,那么用in和exists差别不大,如果两个表中一个较小一个较大,则子查询表小的用exists,子查询表大的用in.

2、not in逻辑上不完全等同于not exists,如果你误用了not in,小心你的程序存在Bug.而且not exists 比not in要快。

3、in与=的相同的。

posted @ 2017-03-27 16:30  luffy_chen  阅读(143)  评论(0编辑  收藏  举报