How to change the values in the table?
How can I change all values US_CITIES.ID_STATE into US_STATES values. STATE_CODE where US_CITIES.ID_STATE is equal to US_STATES.ID?
ID | ID_STATE | CITY
ID | STATE_CODE | STATE_NAME
asked March 12th 20 at 07:59
update US_CITIES usc
join US_STATES uss
on usc.ID_STATE = uss.ID
set usc.ID_STATE = uss.STATE_CODE
where usc.ID_STATE = US_STATES.ID
if I understand correctly your logic aydishnikov
Find more questions by tags SQL