删除重复数据并保留id最小的一条记录

delete from  test where id not in
(

select a.id from (select min(id) as id from test group by form_id ) as a

)

 

一百天记录

 

SELECT
*
FROM
table_name

where date_sub(curdate(), INTERVAL 100 DAY)>=date(FROM_UNIXTIME(add_time))

posted @ 2017-09-20 17:34  未解  阅读(252)  评论(0编辑  收藏  举报