select count(1) from t_amz_fba_virtual_inventory inventory
INNER JOIN (select t.seller_id, t.msku, t.fnsku, t.warehouse_type, t.country_code, max(t.create_time) as create_time from t_amz_fba_virtual_inventory t group by t.seller_id, t.msku, t.fnsku, t.warehouse_type, t.country_code HAVING count(t.asin) > 1) temp
on temp.seller_id = inventory.seller_id and temp.msku = inventory.msku and temp.fnsku = inventory.fnsku and temp.warehouse_type = inventory.warehouse_type and temp.country_code = inventory.country_code
and temp.create_time > inventory.create_time;
重现步骤