I have a table called activation. In here I want to move records older than 30 days to another table. How to do this?
SELECT * DATE_FORMAT(datetime, '%m/%d/%Y')
FROM
tablename
WHERE datetime <= DATE_SUB(SYSDATE(), INTERVAL 30 DAY)
I tried this query but it returns me an error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_FORMAT(datetime, '%m/%d/%Y') FROM activation WHERE datetime <= DATE_SUB(SYS' at line 1