SELECT @from := MAX(date) FROM alerts_daily;
CREATE TEMPORARY TABLE tt SELECT * FROM alerts_daily WHERE date=@from;
UPDATE tt SET date=CURDATE();
INSERT IGNORE INTO alerts_daily SELECT * FROM tt;
