We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最近写的一个用户数据统计相关接口,需要用到按照每天进行分组统计。
SELECT DATE_FORMAT( create_time, "%Y-%m-%d" ) ,sum(user_id) FROM orders WHERE order_state=2 GROUP BY DATE_FORMAT( create_time, "%Y-%m-%d" ) ;
DATE_FORMAT(date,format) //上面代码中使用的是 DATE_FORMAT( create_time, "%Y-%m-%d" )
date 参数是合法的日期。format 规定日期/时间的输出格式。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
最近写的一个用户数据统计相关接口,需要用到按照每天进行分组统计。
直接看语句
DATE_FORMAT函数说明
date 参数是合法的日期。format 规定日期/时间的输出格式。
The text was updated successfully, but these errors were encountered: