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))
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))