My knowledge of MySQL is pretty basic and I struggle with complicated queries - for me, the following problem is complicated - hopefully it's not for you!
I've been importing businesses to my database, some of which have the same company name. For instance, we have two Subway branches in the table, both with different addresses.
I'd like to set the Company Name to be "Company Name" + "Town" so we end up with unique fields:
- Subway London
- Subway Manchester
So far, all I've managed to do is check out which Company names appear in the db twice with:
SELECT CompanyName , count( CompanyName )
FROM directorydata
GROUP BY CompanyName
HAVING count( CompanyName ) >1
How do I go about updating each of the CompanyName field with it's current value, plus that of the Town field?
Your help is greatly appreciated!