Skip to content

Instantly share code, notes, and snippets.

@mauroartizzu
Created February 6, 2013 16:27
Show Gist options
  • Save mauroartizzu/4723761 to your computer and use it in GitHub Desktop.
Save mauroartizzu/4723761 to your computer and use it in GitHub Desktop.
MySQL Full Outer Join
SELECT *
FROM TABELLA1
LEFT JOIN TABELLA2
ON TABELLA1.CAMPO1 = TABELLA2.CAMPO2
UNION
SELECT *
FROM TABELLA1
RIGHT JOIN TABELLA2
ON TABELLA1.CAMPO1 = TABELLA2.CAMPO2
WHERE TABELLA1.CAMPO1 IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment