I have a table of contacts and a table of postcode data.
I need to match the first part of the postcode and the join that with the postcode table… and then perform an update…
I want to do something like this…
UPDATE `contacts` LEFT JOIN `postcodes` ON PREG_GREP("/^[A-Z]{1,2}[0-9][0-9A-Z]{0,1}/", `contacts`.`postcode`) = `postcodes`.`postcode` SET `contacts`.`lat` = `postcode`.`lat`, `contacts`.`lng` = `postcode`.`lng`
Is it possible?? Or do I need to use an external script?
Many thanks.
I decided to approach it from a different angle… there might be a few clashes but I can live with that.