Difference between JOIN and INNER JOIN

前端 未结 6 1883
离开以前
离开以前 2020-11-22 06:31

Both these joins will give me the same results:

SELECT * FROM table JOIN otherTable ON table.ID = otherTable.FK

vs

SELECT *         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 07:08

    INNER JOIN = JOIN

    INNER JOIN is the default if you don't specify the type when you use the word JOIN.

    You can also use LEFT OUTER JOIN or RIGHT OUTER JOIN, in which case the word OUTER is optional, or you can specify CROSS JOIN.

    OR

    For an inner join, the syntax is:

    SELECT ...
    FROM TableA
    [INNER] JOIN TableB

    (in other words, the "INNER" keyword is optional - results are the same with or without it)

提交回复
热议问题