gpt4 book ai didi

mysql - 我想获取 2 个日期之间的数据,但显示 1064 错误

转载 作者:行者123 更新时间:2023-11-29 21:07:59 26 4
gpt4 key购买 nike

我的 mysql 查询是

SELECT
testid,
testName,
DATE(testviewaudit.datetime) ,
SUM(action=1) AS view,
SUM(action=2) AS start,
SUM(action=3) AS finish
FROM testviewaudit
INNER JOIN tmtests
ON estviewaudit.testid = tmtests.tsid
WHERE DATE(testviewaudit.datetime) >= '2016-03-12'
AND DATE(testviewaudit.datetime) <= '2016-03-15'
GROUP BY testid;

使用上述查询时,我收到 1064 错误

最佳答案

您只需在查询之间使用

 SELECT
testid,
testName,
DATE(testviewaudit.datetime),
SUM(action = 1) AS view,
SUM(action = 2) AS start,
SUM(action = 3) AS finish
FROM testviewaudit INNER JOIN tmtests ON estviewaudit.testid = tmtests.tsid
WHERE DATE(testviewaudit.datetime) between '2016-03-12'
AND '2016-03-15' GROUP BY testid;

关于mysql - 我想获取 2 个日期之间的数据,但显示 1064 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36646934/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com