数据库左连接、右连接、全联接、左外、右外、全外

数据库左连接、右连接、全联接、左外、右外、全外

内联

数据库左连接、右连接、全联接、左外、右外、全外
SELECT
*
FROM
temployee employees0
INNER JOIN tcustomer customer1 ON ( customer1.id = employees0.id );

左联

数据库左连接、右连接、全联接、左外、右外、全外
SELECT
*
FROM
temployee employees0
LEFT OUTER JOIN tcustomer customer1 ON ( customer1.id = employees0.id );

右联

数据库左连接、右连接、全联接、左外、右外、全外
SELECT
*
FROM
temployee employees0
RIGHT OUTER JOIN tcustomer customer1 ON ( customer1.id = employees0.id );

全联(MySql不支持)

数据库左连接、右连接、全联接、左外、右外、全外
SELECT * FROM t_employee te FULL JOIN t_customer tc ON (te.id = tc.id);

左外

数据库左连接、右连接、全联接、左外、右外、全外
SELECT
*
FROM
temployee employees0
LEFT OUTER JOIN tcustomer customer1 ON ( customer1.id = employees0.id )
WHERE
customer1_.id IS NULL;

右外

数据库左连接、右连接、全联接、左外、右外、全外
SELECT *
FROM
temployee employees0
RIGHT OUTER JOIN tcustomer customer1 ON ( customer1.id = employees0.id )
WHERE
employees0_.id IS NULL;

全外(MySql不支持)

数据库左连接、右连接、全联接、左外、右外、全外
SELECT *
FROM
t_employee te
FULL JOIN t_customer tc ON ( te.id = tc.id )
WHERE
te.id IS NULL
OR tc.id IS NULL;

猜你喜欢

转载自blog.51cto.com/12012821/2408733