Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:08:21+00:00 2026-06-14T15:08:21+00:00

I am trying to apply a sum function on a table column but i

  • 0

I am trying to apply a sum function on a table column but i am getting error that

ORA-00934: group function is not allowed here
00934. 00000 -  "group function is not allowed here"
*Cause:    
*Action:
Error at Line: 46 Column: 5

Here is the query

select LOSA_APP.app_ref_no AS "App.Ref.No.",  
   CODE_BRANCH.branch_name AS "BRANCH",
   CODE_STAFF.staff_name AS "Officer Name",
   LOSA_CUST.full_name AS "Borrower",
   LOSA_FACILITIES.fac_type AS "Facility Type",
   losa_facilities.amt_appr AS "Limit"
from losa_app LOSA_APP
...
INNER JOIN
    losa_facilities LOSA_FACILITIES
ON
    LOSA_APP.app_ref_no = LOSA_FACILITIES.app_ref_no
where 
    LOSA_APP.app_status='A' 
and 
    .....
and 
    sum(losa_facilities.amt_appr) 

Line 46 is sum(losa_facilities.amt_appr) i also tried sum(losa_facilities.amt_appr) group by losa_facilities.amt_appr but it didn’t work.

Why it is saying that group function is not allowed here ?. What i am doing wrong ?

Thanks

EDIT:
——————————————————————————–

select LOSA_APP.app_ref_no AS "App.Ref.No.",  
   CODE_BRANCH.branch_name AS "BRANCH",
   CODE_STAFF.staff_name AS "Officer Name",
   LOSA_CUST.full_name AS "Borrower",
   LOSA_FACILITIES.fac_type AS "Facility Type",
   LOSA_FACILITIES.amt_appr AS "Limit"
from losa_app LOSA_APP
INNER JOIN
    losa_app_z LOSA_APP_Z  
ON
    losa_app.app_ref_no = losa_app_z.app_ref_no 
INNER JOIN
    code_branch CODE_BRANCH
ON
    LOSA_APP.attend_branch = CODE_BRANCH.branch_id
INNER JOIN
    code_staff CODE_STAFF
ON
    LOSA_APP.attend_staff = CODE_STAFF.staff_id
INNER JOIN
    losa_cust LOSA_CUST
ON
    LOSA_APP.app_ref_no = LOSA_CUST.app_ref_no
INNER JOIN
    losa_facilities LOSA_FACILITIES
ON
    LOSA_APP.app_ref_no = LOSA_FACILITIES.app_ref_no
where 
    LOSA_APP.app_status='A' 
and 
    trunc(sysdate) between (nvl(LOSA_APP_Z.li_dt, LOSA_APP_Z.li_collect_dt)) AND ((trunc(sysdate))) -- falling under the reporting period
and
    (trunc(sysdate) - nvl(losa_app_z.li_dt,losa_app_z.li_collect_dt)) > 90  -- select application cases at any step after entering Documentation flows.
and 
    losa_app.product_type = :productType -- Select records based on input parameter value passed in. 
and
    code_branch.branch_code1 -- Attending IHP Branch passed in from input parameter
    like
    case :inputChannel 
        when 'ABB'  Then '%0232%'
        when 'AiBB' Then '%0347%' 
    end
and
    LOSA_CUST.app_joint_t = 'P' -- Name of PS No. staff name
and 
    GROUP BY (LOSA_APP.app_ref_no, CODE_BRANCH.branch_name, CODE_STAFF.staff_name, LOSA_CUST.full_name, LOSA_FACILITIES.fac_type) 
    HAVING sum(LOSA_FACILITIES.amt_appr) > 0

Error

ORA-00936: missing expression
00936. 00000 -  "missing expression"
*Cause:    
*Action:
Error at Line: 46 Column: 5

Line 46 is GROUP BY (LOSA_APP.app_ref_no, CODE_BRANCH.branch_name,...

I also tried this

select LOSA_APP.app_ref_no AS "App.Ref.No.",  
   CODE_BRANCH.branch_name AS "BRANCH",
   CODE_STAFF.staff_name AS "Officer Name",
   LOSA_CUST.full_name AS "Borrower",
   LOSA_FACILITIES.fac_type AS "Facility Type",
   sum(LOSA_FACILITIES.amt_appr) AS "Limit"
from losa_app LOSA_APP
INNER JOIN
....

Just use sum in the select clause, but in this case i get error that

ORA-00937: not a single-group group function
00937. 00000 -  "not a single-group group function"
*Cause:    
*Action:
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:08:22+00:00Added an answer on June 14, 2026 at 3:08 pm

    To use aggregate functions (like SUM/AVERAGE etc.,) you need to group the results using the GROUP BY clause. To filter results based on the aggregation on a column, you should perform a GROUP BY on the selected columns, and then use the HAVING clause to specify the filter

    select LOSA_APP.app_ref_no AS "App.Ref.No.",  
       CODE_BRANCH.branch_name AS "BRANCH",
       CODE_STAFF.staff_name AS "Officer Name",
       LOSA_CUST.full_name AS "Borrower",
       LOSA_FACILITIES.fac_type AS "Facility Type",
       losa_facilities.amt_appr AS "Limit"
    from losa_app LOSA_APP
    ...
    INNER JOIN
        losa_facilities LOSA_FACILITIES
    ON
        LOSA_APP.app_ref_no = LOSA_FACILITIES.app_ref_no
    where 
        LOSA_APP.app_status='A' 
    and 
        .....
    GROUP BY <all the columns in the  SELECT clause above, except those on which aggregate functions are applied>
    HAVING sum(losa_facilities.amt_appr) <relational operator and value>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to apply regex for not allowing a string with double underscores [a-z][a-z0-9_-]+[^__] but
Trying to apply a 301 redirect to this url /Qx%40w%2C6M42VAwp3%40Rb%7B~cC4ure%60QWI9 but it's not liking
I am trying to apply smoothing filter to image . But I get this
I'm trying to apply a tooltip to a toolstripbutton but it keeps giving me
I'm trying to run apply a function to each row of a dataset. The
I am trying to group row data from a 3-dimensional array by a column
I am trying apply blue theme on my spree website but I am unable
I am trying apply two background images for an entire table row. One background
I'm trying to do a sum on a group with a total of the
I am trying to apply css for my table as show in sample 9.Table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.