• 请不要在回答技术问题时复制粘贴 AI 生成的内容
rqxiao
V2EX  ›  程序员

inner join 和 where 有区别吗?

  •  
  •   rqxiao · Apr 20, 2020 · 2962 views
    This topic created in 2214 days ago, the information mentioned may be changed or developed.

    select b.* from b,c where b.mobile=c.mobile

    select b.* from b inner join c on b.mobile=c.mobile

    explain 显示的内容都是一样的额.

    3 replies    2020-04-20 19:22:15 +08:00
    feelinglucky
        2
    feelinglucky  
       Apr 20, 2020   ❤️ 1
    建议先 Google 以后再提问,这个是很典型的面试题了,一句话就是数据过滤的先后问题,性能方面其实差不多,原理上 INNER JOIN 会高些: https://stackoverflow.com/questions/11533891/difference-between-inner-join-and-where-in-select-join-sql-statement
    xuanbg
        3
    xuanbg  
       Apr 20, 2020
    结果等效,但执行计划不一定相同
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1055 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 18:42 · PVG 02:42 · LAX 11:42 · JFK 14:42
    ♥ Do have faith in what you're doing.