sql删除重复记录

select * from tab_name where id in (
select min(id) from tab_name group by meter_id,Cjq_time having count(*)>1)


delete from tab_name where id in(
select id from (
(select a.id from tab_name a ,
(select meter_id,Cjq_time,min(id) id,count(*) icount from tab_name group by meter_id,Cjq_time having count(*)>1) b
where a.meter_id=b.meter_id and a.cjq_time=b.cjq_time and a.id>b.id )

)c

)

上一篇:javascript – 在setInterval中返回值


下一篇:javascript – 如何使用每次随机毫秒数的setInterval?