使用Grafana如下查询MySQL将得到错误“错误分析间隔'%Y-%m-%d”。哪个datatime是日期字符串,例如“ 2019-12-12”,“ 2019-12-13”。
SELECT
$__timeGroupAlias(UNIX_TIMESTAMP(STR_TO_DATE(datatime, '%Y-%m-%d')),$__interval),
count(dept_id) AS "dept_id"
FROM dm_dept_sales_d
WHERE
$__timeFilter(UNIX_TIMESTAMP(STR_TO_DATE(datatime, '%Y-%m-%d')))
GROUP BY 1
ORDER BY $__timeGroup(UNIX_TIMESTAMP(STR_TO_DATE(datatime, '%Y-%m-%d')),$__interval)
我该如何进行?