SELECT
NULL as id,
t.source_id,
t.airline_name,
t.flight_no,
t.space_type,
t.start_station,
t.start_code,
t.end_station,
t.end_code,
t.transfer_station,
t.product_type,
t.free_space,
t.free_space,
t.effect_date,
NOW(),
NOW()
FROM edc_airline_resource_temp t
LEFT JOIN edc_airline_resource_space s
ON s.effect_date=t.effect_date
and s.airline_name = t.airline_name
and s.flight_no = t.flight_no
and s.space_type = t.space_type
and s.start_station = t.start_station
and s.end_station = t.end_station
and IFNULL(s.transfer_station,'') = IFNULL(t.transfer_station,'')
and s.product_type = t.product_type
where t.effect_date >= CURDATE()
and t.effect_date<=ADDDATE(CURDATE(),2)
and s.id is NULL;
原因:连表的两个表的排序规则不一样,一个为utf8mb4_0900_ai_ci,另一个为:utf8mb4_general_ci