mysql obtains statistical data within a specified time period Statistics by year SELECT count(*), DATE_FORMAT(order_info.create_time, '%Y-%m-%d') AS count_by_date FROM order_info WHERE DATE_FORMAT(order_info.create_time, '%Y') = '2017' GROUP BY count_by_date ORDER BY NULL Statistics by month SELECT count(*), DATE_FORMAT(order_info.create_time, '%Y-%m-%d') AS count_by_date FROM order_info WHERE DATE_FORMAT(order_info.create_time, '%Y-%m') = '2017-04' GROUP BY count_by_date ORDER BY NULL The specific transformation can be changed according to your needs Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: js to write the carousel effect
>>: Detailed installation and use of virtuoso database under Linux system
MySQL previously had a query cache, Query Cache. ...
Zero: Uninstall old version Older versions of Doc...
Seamless carousel is a very common effect, and it...
The find command is used to search for files in a...
Following are the quick commands to clear disk sp...
Table of contents 1. Insert 2. Update 3. Delete 1...
Text carousels are very common in our daily life....
(1) Experimental environment youxi1 192.168.5.101...
The Docker Hub we used earlier is provided by Doc...
<br />This tag is used to create a multi-lin...
Authorization is to grant certain permissions to ...
jQuery realizes the effect of theater seat select...
Preface Before starting this article, let’s do a ...
Scenario 1. Maintain a citizen system with a fiel...
1. MySQL transaction concept MySQL transactions a...