(1)select a.* from tb1 a left join tb2  b on a.id=b.id where Sqlserver自动优化a.name='1'


(2)select * from (select a.* from  tb1 a left join tb2 b on a.id=b.id) as d where name='1'


(3)建视图tbView :select a.* from  tb1 a left join tb2 b on a.id=b.id

select * from tbView as d where name='1'

这三种写法执行效率一模一样,印象中应该第一种写法最快。 

相关文章:

  • 2021-11-09
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-09-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-08-25
  • 2021-09-26
相关资源
相似解决方案