What is the difference between Left, Right, Outer and Inner Joins?

后端 未结 9 1872
刺人心
刺人心 2020-11-22 07:10

I am wondering how to differentiate all these different joins ...

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 08:02

    SQL JOINS difference:

    Very simple to remember :

    INNER JOIN only show records common to both tables.

    OUTER JOIN all the content of the both tables are merged together either they are matched or not.

    LEFT JOIN is same as LEFT OUTER JOIN - (Select records from the first (left-most) table with matching right table records.)

    RIGHT JOIN is same as RIGHT OUTER JOIN - (Select records from the second (right-most) table with matching left table records.)

提交回复
热议问题