2
MySQL COUNT today week month
SELECT
*,
COUNT(IF(date >= curdate(), 1, NULL)) 'todaycount',
COUNT(IF(yearweek(date) = yearweek(curdate()), 1, NULL)) 'weekcount',
COUNT(IF(month(date) = month(curdate()), 1, NULL)) 'monthcount',
COUNT(IF(date <= curdate(), 1, NULL)) 'allcount'
FROM
mytable
Interserver | Standard & VPS Cloud Hosting | $2.50 /Month
Flexible VPS hosting platform to deploy your online projects.
Economical and balanced between processor cores, memory and storage
rated 2 times
(2)
(0)
comments: 1 / hits: 935
/ 2 years ago, wed, jan 6, 21, 02:42:50
More From
» SQL
Comments
1
How about:
Code:
[#56] Sunday, January 10, 2021, 4:03:20

commented 2 years ago
suppe