MySQL Join clause vs WHERE clause

前端 未结 4 1621
深忆病人
深忆病人 2020-12-15 19:13

What\'s the difference in a clause done the two following ways?

SELECT * FROM table1 INNER JOIN table2 ON (
    table2.col1 = table1.col2 AND
    table2.memb         


        
4条回答
  •  攒了一身酷
    2020-12-15 19:47

    With an inner join, it makes almost* no difference; if you switch to outer join, all the difference in the world.

    *I say "almost" because optimizers are quirky beasts and it isn't impossible that under some circumstances, it might do a better job optimizing the former or the latter. Do not attempt to take advantage of this behavior.

提交回复
热议问题