我的数据库中有 3 个表“ countries, cities and address_book”
表:国家
country_code (primary key)
country_Name
表:城市
country_code (primary key)
city_code (primary key)
city_Name
表:地址簿
country_code (primary key)
city_code (primary key)
address
我需要设置cities如下表
country_id city_id ciTy_name
IN 1 IN_city_name_1
IN 2 IN_city_name_2
AE 1 AE_city_name_1
AE 2 AE_city_name_2
但是我
city_i表中 d 的主键cities不允许我用重复键更新表当我
city_id在表中更新时cities。我需要city_id根据address_book主键更新country_id