所以我有一个地址表和一个联系人表。
我正在尝试将Contacts中的contact_id [int],address_street [varchar(256)],address_city [varchar(80)],address_state [varchar(20)],address_country [varchar(5)]复制到这些列中,来自地址的contact_id [int],street1 [varchar(128)],city [varchar(128)],state [varchar(128)],country [varchar(128)]。
我通过java接口使用的命令是insert into Addresses ( contact_id, street1, city, state, country) select id, address_street, address_city, address_state, address_country from Contacts)
。错误来自varchar大小的不匹配,因为根据https://catdevblog.nickbair.net/2012/04/05/mysql-copying-column-data-between-tables/我不认为mysql语句是错误的。