Comparing 2 tables & updating records

Here is what I have

table_1

id
new_id

table_2

id

what I want to do:

compare table_1.id with table_2.id and if they are same replace table_2.id with table_1.new_id

for example

table_1

1 122
2 123
3 124

table_2

1
2
3

after running the script in table_2 i should get

122
123
124

The database is MySQL. Hence even if I get MySQL statement to run directly on database thats fine

Thanks in advance

UPDATE table_1, table_2 SET table_2.id = table_1.new_id WHERE table_1.id = table_2.id

hi Dan.

thanks a ton for your answer. works perfect!