DELETE FROM `obd_comprehensive_d_1` USING `obd_comprehensive_d_1`,( SELECT DISTINCT MIN(`id`) AS `id` , box_id,data_time FROM `obd_comprehensive_d_1` GROUP BY `box_id`,`data_time` HAVING COUNT(1) > 1 ) AS `t2` WHERE `obd_comprehensive_d_1`.`box_id` = `t2`.`box_id` AND `obd_comprehensive_d_1`.`data_time` = `t2`.`data_time` AND `obd_comprehensive_d_1`.`id` <> `t2`.`id`;