Skip to content

Instantly share code, notes, and snippets.

@relax-more
Created October 30, 2012 10:33
Show Gist options
  • Save relax-more/3979509 to your computer and use it in GitHub Desktop.
Save relax-more/3979509 to your computer and use it in GitHub Desktop.
[MySQL] date_format のサンプル
SELECT date_format(update_datetime, '%Y/%m/%d') AS date, description, url, COUNT(*)
FROM any_table
GROUP BY date_format(update_datetime, '%Y/%m/%d'), description, url
ORDER BY description, date DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment