There is a one table,
City[city_id,state_id]
There was another table in same database,
Registration[reg_id,city_id]
Now, i have added one more column into ‘Registration’ table, so it is become as shown below,
Registration[reg_id,city_id,state_id]
But, the problem is that values of the state_id column is ‘0’. So, How can i insert value of state_id column of “Registration” table from the “City” table according to matching city_id value of “Registration” table.
As long as this query will be performed just once – you could use this not efficient, but readable query: