Skip to content

Instantly share code, notes, and snippets.

@duan-li
Created November 9, 2015 00:10
Show Gist options
  • Save duan-li/3c2b6dd8700719adbde1 to your computer and use it in GitHub Desktop.
Save duan-li/3c2b6dd8700719adbde1 to your computer and use it in GitHub Desktop.
select query to find users trend from mysql
select count(id), join_datetime from customers
where status > 0
group by DATE(join_datetime)
order by join_datetime desc
select count(id), join_datetime from customers
where status > 0
group by MONTH(join_datetime)
order by join_datetime desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment