IBM Informix-SQL syntax error, basic query from Microsoft BIDS to Cisco UCCX database

落花浮王杯 提交于 2019-12-11 06:26:22

问题


I'm running the below query against an IBM Informix database and getting an ERROR 42000: A syntax error has occurred. The FROM and WHERE clauses run fine in other queries, so I'm looking at the SELECT and GROUP BY portions. Any ideas what's wrong with the syntax?

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)

The goal btw is to find the total number of unique calls (calls_abandoned) that occur on each day of the month (1-31).


回答1:


Replace the

GROUP BY DAY("informix".agentconnectiondetail.startdatetime)

by

GROUP BY 2



来源:https://stackoverflow.com/questions/40730419/ibm-informix-sql-syntax-error-basic-query-from-microsoft-bids-to-cisco-uccx-dat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!