教程视频中的内容与最新版本的功能有些差别了,最大的问题是,我在 navicat 可以执行的SQL在 DataEase
数据集中执行报错:
SQL 内容:
SELECT
COUNT(*) AS 总量,
SUM(CASE WHEN DATE(access_time) = CURDATE() THEN 1 ELSE 0 END) AS 今天,
SUM(CASE WHEN DATE(access_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY) THEN 1 ELSE 0 END) AS 昨天,
SUM(CASE WHEN DATE(access_time) >= DATE_SUB(CURDATE(), INTERVAL 3 DAY) AND DATE(access_time) < CURDATE() THEN 1 ELSE 0 END) AS 过去3天,
SUM(CASE WHEN DATE(access_time) >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND DATE(access_time) < CURDATE() THEN 1 ELSE 0 END) AS 过去7天,
SUM(CASE WHEN DATE(access_time) >= DATE_SUB(CURDATE(), INTERVAL 15 DAY) AND DATE(access_time) < CURDATE() THEN 1 ELSE 0 END) AS 过去15天,
SUM(CASE WHEN DATE(access_time) >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) AND DATE(access_time) < CURDATE() THEN 1 ELSE 0 END) AS 过去30天
FROM
user_action
WHERE
action_type = 1 AND
status = 0;
报错信息:
使用 Calcite 进行语法分析发生了异常:org.apache.calcite.sql.parser.SqlParseException: Encountered “;” at line 13, column 13. Was expecting one of: “EXCEPT” … “FETCH” … “GROUP” … “HAVING” … “INTERSECT” … “LIMIT” … “OFFSET” … “ORDER” … “QUALIFY” … “MINUS” … “UNION” … “WINDOW” … “.” … “NOT” … “IN” … “<” … “<=” … “>” … “>=” … “=” … “<>” … “!=” … “BETWEEN” … “LIKE” … “ILIKE” … “RLIKE” … “SIMILAR” … “+” … “-” … “*” … “/” … “%” … “||” … “AND” … “OR” … “IS” … “MEMBER” … “SUBMULTISET” … “CONTAINS” … “OVERLAPS” … “EQUALS” … “PRECEDES” … “SUCCEEDS” … “IMMEDIATELY” … “MULTISET” … “[” … “FORMAT” …