【发布时间】:2013-02-25 08:52:50
【问题描述】:
我想知道这两个版本在结果上是否相同,哪个版本出于性能原因更好,为什么? 选择版本中的嵌套选择
select
t1.c1,
t1.c2,
(select Count(t2.c1) from t2 where t2.id = t1.id) as count_t
from
t1
VS
select t1.c1,t1.c2, Count(t2.c1)
from t1,t2
where t2.id= t1.id
【问题讨论】: