【发布时间】:2010-07-22 05:02:05
【问题描述】:
select *
from ContactInformation c
where exists (select * from Department d where d.Id = c.DepartmentId )
select *
from ContactInformation c
inner join Department d on c.DepartmentId = d.Id
这两个查询都给出相同的输出,这在性能明智的联接或与存在子句的关联子查询中是好的,哪个更好。
编辑:-是否有连接方式,以提高性能:- 在上述 2 个查询中,我想要来自部门的信息以及联系信息表
【问题讨论】:
标签: sql