7 type join in sql

Join in the SQL clause is used to connect the table, view, query sub together through the foreign key column or the corresponding value in both tables, views or sub query.
Today, I would like to share with you 7 type Join in SQL.  You can reference
join in mysql
INNER JOIN
SELECT * FROM A INNER JOIN B ON A.key = B.key


LEFT JOIN
SELECT * FROM A LEFT JOIN B ON A.key = B.key


LEFT JOIN (sans l’intersection de B)
SELECT * FROM A LEFT JOIN B ON A.key = B.key WHERE B.key IS NULL


RIGHT JOIN
SELECT * FROM A RIGHT JOIN B ON A.key = B.key


RIGHT JOIN (sans l’intersection de A)
SELECT * FROM A RIGHT JOIN B ON A.key = B.key WHERE B.key IS NULL


FULL JOIN
SELECT * FROM A FULL JOIN B ON A.key = B.key

FULL JOIN (sans intersection)
SELECT * FROM A FULL JOIN B ON A.key = B.key WHERE A.key IS NULL OR B.key IS NULL
0 Comments for "7 type join in sql"
Back To Top