Skip to content

Instantly share code, notes, and snippets.

@shyuan
Created October 26, 2017 08:15
Show Gist options
  • Save shyuan/c8b883ee3bd0c33b096f8da8f5a20d84 to your computer and use it in GitHub Desktop.
Save shyuan/c8b883ee3bd0c33b096f8da8f5a20d84 to your computer and use it in GitHub Desktop.
Counting group by date with a UNIX timestamp column
SELECT FROM_UNIXTIME(`created_at`, '%Y.%m.%d') AS ndate, COUNT(1) AS xx_table_count FROM xx_table GROUP BY ndate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment