Using IW and MM in Oracle

后端 未结 1 1474
悲哀的现实
悲哀的现实 2021-01-16 17:57

I\'m using IW for weekly result and MM for Monthly result. But I always get an error:

ORA-00979: not a GROUP BY expression
00979. 00000 -  \"not a GROUP BY e         


        
相关标签:
1条回答
  • 2021-01-16 18:38

    You have to group by the same expression you use in the SELECT clause.

    So if you:

    SELECT TRUNC(t.CREATE_TIME, 'MM') AS report_date,count(*) AS cnt_opened
    

    ... then you have to ...

    GROUP BY TRUNC(t.CREATE_TIME,'MM')
    
    0 讨论(0)
提交回复
热议问题