如何在 Informix 中将 group by 子句与小时一起使用?
这里的 group by section 给出了一个错误:
SELECT
cqdr.targetid,
cqdr.profileid,
ccdr.startdatetime::DATETIME HOUR TO HOUR AS CallHour,
Count(cqdr.sessionid),
(Sum(cqdr.queuetime) / Count(cqdr.sessionid)),
Max(cqdr.queuetime)
FROM Contactqueuedetail cqdr, Contactcalldetail ccdr, Selected_csqs sc
WHERE cqdr.sessionid = ccdr.sessionid AND
cqdr.sessionseqnum = ccdr.sessionseqnum AND
cqdr.profileid = ccdr.profileid AND
cqdr.nodeid = ccdr.nodeid AND
ccdr.startdatetime BETWEEN DATE('12/6/27') AND DATE('12/6/28') AND
--cqdr.targettype = l_typecsq AND
cqdr.targetid = sc.csqrecordid AND
cqdr.profileid = sc.profileid
GROUP BY ccdr.startdatetime::DATETIME HOUR TO HOUR, cqdr.targetid, cqdr.profileid;