[Database] - JOIN Table
Thursday, October 12, 2017
We can JOIN table so that select records that having matching value in both tables.We can use so that replaced FROM statement.
It has four join type: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN
INNER JOIN
Get the common element of two table. The same with many tables.
LEFT JOIN
RIGHT JOIN
Syntax:
SELECT column1, column2, …
FROM table 1
INNER JOIN/LEFT JOIN/RIGHT JOIN/ FULL JOIN table2 ON table1.column1 = table2.column1 AND ….
is updating...
It has four join type: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN
INNER JOIN
Get the common element of two table. The same with many tables.
LEFT JOIN
Get all elements of table 1 and matched the element of table 2.
RIGHT JOIN
Get matched elements of table 1 and all elements of table 2.
FULL JOIN
Get all elements of 2 tables when there are matched both tables.
SELECT column1, column2, …
FROM table 1
INNER JOIN/LEFT JOIN/RIGHT JOIN/ FULL JOIN table2 ON table1.column1 = table2.column1 AND ….
is updating...
Bài liên quan
Comments[ 0 ]
Post a Comment