declare @t1 table ( id int ,  val varchar(20))  

insert into @t1
 select 1 , 'a'
union select 2 , 'b'  
union select 3 , 'd' ;

declare @t2 table ( id int ,  val varchar(20))  

insert into @t2
select 2 , 'b'  
union select 3 , 'b'   
union select 4 , 'c'  ;

 
 select * from @t1 ;
 select * from @t2 ;

select *
from @t1 t1
left join @t2 t2 on ( t1.val = t2.val)

LeftJoin 扫描两个结果集,对外表来说是 左行数 个表扫描。

相关文章:

  • 2021-10-21
  • 2022-01-20
  • 2022-02-25
  • 2021-10-11
  • 2021-12-02
  • 2022-01-28
  • 2021-12-28
猜你喜欢
  • 2022-02-04
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案