我正在使用此语句从另一个表插入记录:
SQL> insert into city(city_code, country_code, city)
select distinct(city_code), country_code, city_name
from airport_final;
2 3
9012 rows created.
我发现很多重复的记录:
SQL> SELECT city_code, COUNT(city_code)
FROM airport_final
GROUP BY city_code
HAVING COUNT(city_code) > 1;
VRA 2
WBU 3
YMQ 4
YPR 2
330 rows selected.
我不知道我正在选择不同的记录,但为什么它会插入重复项
此致