delete iot_instruction
from
iot_instruction,
(
SELECT
min(id) id,
GROUP_CONCAT(id) as ids,
command,
instruction_type,
protocol_id
FROM
iot_instruction
GROUP BY
command,instruction_type,protocol_id
HAVING
count(*) > 1
) t2
where iot_instruction.command = t2.command and iot_instruction.protocol_id = t2.protocol_id
and iot_instruction.instruction_type= t2.instruction_type and iot_instruction.id>t2.id;
05-17
5万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-02
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-20
9217
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)