SQL JOIN - WHERE clause vs. ON clause

前端 未结 19 1928
深忆病人
深忆病人 2020-11-21 11:56

After reading it, this is not a duplicate of Explicit vs Implicit SQL Joins. The answer may be related (or even the same) but the question is diffe

19条回答
  •  耶瑟儿~
    2020-11-21 12:47

    Regarding your question,

    It is the same both 'on' or 'where' on an inner join as long as your server can get it:

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

    and

    select * from a inner join b where a.c = b.c
    

    The 'where' option not all interpreters know so maybe should be avoided. And of course the 'on' clause is clearer.

提交回复
热议问题