Skip to content

Instantly share code, notes, and snippets.

@ammaaim
Created December 10, 2014 13:08
Show Gist options
  • Save ammaaim/86fb0fe397e1cd168670 to your computer and use it in GitHub Desktop.
Save ammaaim/86fb0fe397e1cd168670 to your computer and use it in GitHub Desktop.
remove all older rows sql
-- FOR MySQL -disable safemode
SET SQL_SAFE_UPDATES = 0;
-- for example remove all older than '2014-10-01'
DELETE FROM `base-name`.`table-name` WHERE `table-name`.`date-field` < '2014-10-01';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment