Skip to content

Instantly share code, notes, and snippets.

@haio
Last active December 15, 2015 08:59
Show Gist options
  • Save haio/5234792 to your computer and use it in GitHub Desktop.
Save haio/5234792 to your computer and use it in GitHub Desktop.
SQL functions
COALESCE ---> COALESCE(column, default)
INTERVAL ---> DATE(time_column) + INTERVAL 1 DAY
TIMESTAMPDIFF ---> TIMESTAMPDIFF(SECOND, '2012-12-12: 12:12:12', '2013-13-13 13:13:13') --DAY/MINUTE/HOUR/YEAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment