这里最新数据按时间
delete from tb_mb_stock_quantity where pk in( SELECT T.pk FROM (SELECT A.*,ROW_NUMBER() OVER(PARTITION BY 需要分组的字段 ORDER BY 时间字段 DESC) RW FROM 表 A ) T WHERE T.RW > 1 ); commit;