MySQL : Can't use FULL JOIN?
I asked a question about how to find data that doesn't match from a two different table before and after doing some research myself, I found that some people are using the FULL JOIN statement in their script. I tried using the FULL JOIN thing but it doesn't work. Maybe it's not supported in MySQL or because my version is outdated. So, I tried using LEFT JOIN UNION ALL with RIGHT JOIN. Not sure if that's the correct way though. The results? The SQLyog is still running since yesterday! So tell me if this is correct or not and does it make a neverending loop?
SELECT mas_newitem.itemcode,hq_itemtemp.longname,hq_itemtemp.productcode
FROM mas_newitem
LEFT JOIN hq_itemtemp
ON mas_newitem.longname=hq_itemtemp.longname
WHERE mas_newitem.itemcode <> hq_itemtemp.productcode
and hq_itemtemp.outletcode='005'
and hq_itemtemp.deptcode='05'
UNION ALL
SELECT mas_newitem.itemcode,hq_itemtemp.longname,hq_itemtemp.productcode
FROM mas_newitem
RIGHT JOIN hq_itemtemp
ON mas_newitem.longname=hq_itemtemp.longname
WHERE mas_newitem.itemcode <> hq_itemtemp.productcode
and hq_itemtemp.outletcode='005'
and hq_itemtemp.deptcode='05';
Sorry, I'm new in this so.......