I am querying 2 tables to get nonmatching values based on city, zip code, and fullname.
Table A has 30,000 records, Table B has 2,000 records.
I tried inner join by assigning ON condition != It produces duplicates of about 3 Values to fill up the 32000 records.
'23997', 'Dr ***', '107 ***', 'Bogota', 'ks', '** bo', '*****2', '1807'
'23997', 'Dr ***', '107 ***', 'Bogota', 'ks', '** bo', '*****2', '1807'
SELECT s.id, s.Fullname, s.Address, s.city, s.Province, s.Zipcode, s.telephone, c.id
FROM scotlist s
JOIN allcustmomers c
ON c.city != s.City AND c.Zipcode != s.Zipcode AND c.Fullname != s.Fullname
order by s.id DESC;
If I do LEFT JOIN I am sure I will get all records of Table A, but that is not what I need. What am looking for is the unmatching records from table A if they do not match Table B