Monday, 24 December 2018

FULL OUTER JOIN in MySQL

MySQL doesn’t support the FULL OUTER JOIN, so I did some googleing and found this:
Method 1 worked great for me; a UNION between a LEFT OUTER JOIN and a RIGHT OUTER JOIN.
 SELECT * FROM `left` L
 LEFT OUTER JOIN `right` R on L.sku = R.sku
 UNION
 SELECT * FROM `left` L
 RIGHT OUTER JOIN `right` R on L.sku = R.sku

0 comments:

Post a Comment