insert ON DUPLICATE KEY UPDATE 遇到唯一主键 相同 就更新

insert into new_schedules_spider_p2p_static(
               ID,SCAC,CARRIER_NAME,POL_NAME_EN,POL_CODE,
               POL_CITY_ID,POL_COUNTRY,POD_NAME_EN,POD_CODE,POD_CITY_ID,
               POD_COUNTRY,SERVICE,ROUTE_CODE,VESSEL,VOYAGE,
               MD5,IS_TRANSIT,TRANSIT_PORT_EN,TRANSIT_PORT_CODE,TRANSIT_ROUTE_CODE,
               VESSEL_AFTER_TRANSIT,VOYAGE_AFTER_TRANSIT,SECOND_TRANSIT_PORT_EN,SECOND_TRANSIT_PORT_CODE, SECOND_TRANSIT_ROUTE_CODE,
               SECOND_VESSEL_AFTER_TRANSIT,SECOND_VOYAGE_AFTER_TRANSIT,THIRD_TRANSIT_PORT_EN,THIRD_TRANSIT_PORT_CODE,THIRD_TRANSIT_ROUTE_CODE,
               THIRD_VESSEL_AFTER_TRANSIT,THIRD_VOYAGE_AFTER_TRANSIT
             )values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
                       %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
                       %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,
                       %s,%s) ON DUPLICATE KEY UPDATE UPDATE_TIME = now()

 

你可能感兴趣的:(insert ON DUPLICATE KEY UPDATE 遇到唯一主键 相同 就更新)