我需要从table1中获取一些数据,并从table2中只获取一列。什么查询更好?性能等方面有什么不同?加入或嵌套选择
select t1.Col1, t1.Col2,
(select t2.Name from table2 t2 where t1.Code = t2.Code) as 'Name'
from table1 t1
或
select t1.Col1, t1.Col2, t2.Name
from table1 t1
left join table2 t2 on t1.Code = t2.Code