Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Recieving error: ORA-00937: not a single-group group function

User_M4XGBDec 20 2022

I am running the following query which is giving the error ORA-00937: not a single-group group function. I tried moving the sum statement outside the subquery which doesn't help.

select *
from (
select project_name, 
  case 
    when :P33_RG = 'Daily' then
      to_char(date_sys, 'MM/DD/YYYY') 
    when :P33_RG = 'Weekly' then
      to_char(TRUNC(date_sys, 'IW'), 'MM/DD/YYYY')
    else
      ('no date')
  end as my_date,  
  sum(BATCH.RECORDS_NUMBER) as Count_of_Documents
from BATCH
where date_sys between :P33_START_DATE and :P33_END_DATE
) my_records
group by project_name, my_date
;

Any advice to fix it would be appreciated. Thank!

Comments

Post Details

Added on Dec 20 2022
2 comments
781 views