By tilting my head against the wall with this.
I have a table containing zip codes and street names, and I have another table where Houses are listed for sale (where there is no street name), and I'm trying to get the street name for each postal code.
The problem is that table 1 stores the zip code without a space, and table 2, which I am trying to update, stores the zip code in space.
So, in table 1, the zip code is stored as "l249pb", and table 2 is stored as "l24 9pb".
Now, if the postal codes, where both are stored in exactly the same format, without a space, I expect this request to work:
UPDATE Table1
INNER JOIN Table2 ON ( Table1.PostCode = Table2.PostCode )
SET Table1.StreetName = Table2.StreetName
I tried this, but it does not work:
UPDATE Table1
INNER JOIN Table2 ON ( Table1.PostCode = REPLACE(Table2.PostCode,' ',''))
SET Table1.StreetName = Table2.StreetName
- , , (, , ).
, .