只需要获取当前周的记录。创建的列格式为“2013-11-13 00:00:00
”
SELECT COUNT( * ) AS con
FROM `accounts`
WHERE `description` LIKE '%Earned%' AND created = __________
答案 0 :(得分:3)
SELECT COUNT( * ) AS con
FROM `accounts`
WHERE `description` LIKE '%Earned%'
AND yearweek(created) = yearweek(curdate())
答案 1 :(得分:1)
SELECT COUNT( * ) AS con
FROM `accounts`
WHERE `description` LIKE '%Earned%' AND
WEEK(created) = WEEK(curdate()) AND
YEAR(created) = YEAR(curdate())