Oracle报错ORA-00979不是GROUP BY表达式
作者:互联网
oracle与mysql不同,GROUP BY必须要跟select查询的所有列(除了聚合函数外) 例如:
SELECT TO_DATE(EVENTTIME) as dateTime ,OPNO as siteNum, count(*) as totalCapacity FROM tblusercapacity <where> <if test="date != null"> TO_DATE(EVENTTIME) = TO_DATE(#{date},'yyyy-mm-dd') </if> <if test="siteNum != null and siteNum != ''"> AND OPNO = #{siteNum} </if> <if test="userNum != null"> AND USERNO = #{userNum} </if> <if test="workshopNum != null"> AND FACTORYNO = #{workshopNum} </if> </where> GROUP BY opno,EVENTTIME
标签:OPNO,EVENTTIME,GROUP,00979,报错,DATE,siteNum 来源: https://blog.csdn.net/xfy18317776108/article/details/95165515