我正在针对IBM Informix数据库运行以下查询并获得ERROR 42000: A syntax error has occurred
。 FROM和WHERE子句在其他查询中运行正常,因此我查看SELECT和GROUP BY部分。任何想法语法有什么问题?
SELECT COUNT(DISTINCT "informix".agentconnectiondetail.sessionid) AS calls_abandoned,
DAY("informix".agentconnectiondetail.startdatetime) AS Expr2
FROM "informix".agentconnectiondetail, "informix".contactqueuedetail, "informix".contactservicequeue
WHERE "informix".agentconnectiondetail.sessionid = "informix".contactqueuedetail.sessionid AND
"informix".contactqueuedetail.targetid = "informix".contactservicequeue.recordid AND "informix".contactqueuedetail.disposition = 1 AND
"informix".agentconnectiondetail.startdatetime BETWEEN '2016-10-1 00:00:00' AND CURRENT
GROUP BY DAY("informix".agentconnectiondetail.startdatetime)
目标btw是查找每月中每一天(1-31)发生的唯一呼叫总数(calls_abandoned)。
答案 0 :(得分:1)
替换
GROUP BY DAY(" informix" .agentconnectiondetail.startdatetime)
通过
GROUP BY 2