I have two tables, first called list_city contain list of city in Europe, example:
=========================
= ID = CITY = COUNTRY =
=========================
= 1 = LONDON = UK =
= 2 = PARIS = France =
= 3 = ROME = Italy =
=========================
and the second one is data_customer, contain id_cust and city (but in mess typing)
====================
= ID_CUST = CITY =
====================
= 012AGH = paris =
= 2X4BV = London =
= M3RT45 = romE =
= 1F546 = Lndon =
= 345GC = PArs =
= 54A78 = roma =
====================
How I can matching in the city in the second table with the city in the first table in mysql so the output will be:
====================
= ID_CUST = CITY =
====================
= 012AGH = PARIS =
= 2X4BV = LONDON =
= M3RT45 = ROME =
= 1F546 = LONDON =
= 345GC = PARIS =
= 54A78 = ROME =
====================
I tried
SELECT c1.ID_CUST, c2.CITY FROM data_customer c1 INNER JOIN list_city c2
ON c1.CITY LIKE concat('%',c2.CITY,'%');
But, It's seem not work as Iexpected. It's possible do it only in mysql? If not can anyone give me another solution? Thank you very much I really appreciate your time to help me.