need help building a query to replace fields on a table that match a second table.

table1

```
city

```

table2

```
city | code

```

I need replace all occurrences of city on table1 by code of the table2 matching the city field