标签:limit where bsp not set value count group 查询
查询
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 查询
原文地址:https://www.cnblogs.com/xiaowangba9494/p/13299658.html