select t1.*
from t1,(select c from t2 where ...) t3
where t1.c=t3.c
----------------------
select t1.*
from t1
where t1.c in (select c from t2 where ...)
---------------------
问下,这两句查询的结果是不是不一样,为什么呢?
from t1,(select c from t2 where ...) t3
where t1.c=t3.c
----------------------
select t1.*
from t1
where t1.c in (select c from t2 where ...)
---------------------
问下,这两句查询的结果是不是不一样,为什么呢?
这里面有重复的数据吧.
第二个不会.
第一个是找出t1中和t2中c相同的t1记录
第二个是找出t1中c存在t2中的记录,也就是第一个,
效率的话,第一个比较好
加个distinct,不过这样好不?