Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created October 27, 2010 16:35
Show Gist options
  • Save gavinblair/649402 to your computer and use it in GitHub Desktop.
Save gavinblair/649402 to your computer and use it in GitHub Desktop.
select rows with timestamp within the last 30 days
SELECT * FROM mytable WHERE timestamp > DATE_SUB(NOW(), INTERVAL 30 day);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment