2008年3月17日
摘要: 语法IN和EXISTS:IN适合于外表大而内表小的情况;EXISTS适合于外表小而内表大的情况。示例:select * from t1 where t1.x in ( select t2.y from t2 )select * from t1 where exists ( select null from t2 where t2.y = t1.x ) 说明: in 事实上可以理解为: select * from t1, (select distinct y from t2 ) t2 where t1.x = t2.y; ——如果你有一定的SQL优化经验,从这句很自... 阅读全文
posted @ 2008-03-17 17:13 skins 阅读(296) 评论(0) 推荐(0)