时间:2021-07-01 10:21:17 帮助过:4人阅读
查询
SELECT
*
FROM
table A
WHERE
( A.the_date, A.exponent_code, A.exponent_value ) IN ( SELECT the_date, exponent_code, exponent_value FROM table GROUP BY the_date, exponent_code, exponent_value HAVING COUNT ( * ) > 1 )
AND A.ID NOT IN ( SELECT MIN ( ID ) FROM table GROUP BY the_date, exponent_code, exponent_value HAVING COUNT ( * ) > 1 )
LIMIT 10000 OFFSET 1
删除
DELETE
FROM
table A
WHERE
( A.the_date, A.exponent_code, A.exponent_value ) IN ( SELECT the_date, exponent_code, exponent_value FROM table GROUP BY the_date, exponent_code, exponent_value HAVING COUNT ( * ) > 1 )
AND A.ID NOT IN ( SELECT MIN ( ID ) FROM table GROUP BY the_date, exponent_code, exponent_value HAVING COUNT ( * ) > 1 )
数据库去重
标签:limit where bsp not set value count group 查询