我正在尝试计算一个值,我从工作日和一年的前3个月得到计数。
SELECT
SUM(count_LP) AS down1
FROM
`splittest`
WHERE DAYOFWEEK(DATE) = 2
AND (
dato BETWEEN 2014-01-01
AND 2014-04-01
)
当我添加BETWEEN时,它会停止工作。
有什么想法吗?
答案 0 :(得分:2)
指定日期,例如'2014-01-01'
SELECT
SUM(count_LP) AS down1
FROM
`splittest`
WHERE DAYOFWEEK(DATE) = 2
AND (
dato BETWEEN '2014-01-01'
AND '2014-04-01'
)