摘要:
网上可以查到很多这样的说法: 如果查询的两个表大小相当,那么用in和exists差别不大。如果两个表中一个较小,一个是大表,则子查询表大的用exists,子查询表小的用in: 例如:表A(小表),表B(大表)1:select * from A where cc in (select cc from 阅读全文
摘要:
实践出真知! 使用union连接 select `id` from `表名` where 0=0 and active=1 and `fullname` like '王%' union select `id` from `表名` where 0=0 and active=1 and `usernam 阅读全文