SELECT * FROM A LEFT JOIN B ON A.KEY = B.KEY
SELECT * FROM A RIGHT JOIN B ON A.KEY = B.KEY
SELECT * FROM A INNER JOIN B ON A.KEY = B.KEY
1 SELECT * FROM A FULL OUTER JOIN B ON A.KEY = B.KEY #Mysql不支持
2 SELECT * FROM A LEFT JOIN B ON A.KEY=B.KEY
UNION
SELECT * FROM A RIGHT JOIN B ON A.KEY=B.KEY
SELECT * FROM A LEFT JOIN B ON A.KEY = B.KEY WHERE B.KEY IS NULL
SELECT * FROM A RIGHT JOIN B ON A.KEY = B.KEY WHERE A.KEY IS NULL
1 SELECT * FROM A FULL OUTER JOIN B ON A.KEY = B.KEY WHERE A.KEY IS NULL OR B.KEY IS NULL #mysql不支持
2 SELECT * FROM A LEFT JOIN B ON A.KEY=B.KEY WHERE B.KEY IS NULL UNION SELECT * FROM A RIGHT JOIN B ON A.KEY=B.KEY WHERE A.KEY IS NULL