Solved

How can I group and sumarize dollar amounts by sales office, sales rep, and client

Posted on 2013-01-22
3
620 Views
Last Modified: 2013-01-22
How can I group and sumarize dollar amounts by sales office, sales rep, and client  

I keep getting error with code below:

[1]: ORA-00937: not a single-group group function

Select extract(month from rslcd.rfp_requested_beg_dt) as rmonth, sum(rslf.rfp_est_annual_premium_amt)
from adm.rfp_sl_fact rslf
join adm.b_rfp_sl_coverage_dim rslcd on rslf.rfp_sl_coverage_key = rslcd.rfp_sl_coverage_key
where  extract(month from rslcd.rfp_requested_beg_dt) = 10
and extract(year from rslcd.rfp_requested_beg_dt) = 2011
0
Comment
Question by:conardb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 38807235
You group by all non-aggregate columns.

From the SQL you posted, you SUM on rslf.rfp_est_annual_premium_amt, so you need to group by extract(month from rslcd.rfp_requested_beg_dt).

If you add additional columns for sales office, sales rep, and client , you will need to group by those as well.

If you can provide some sample data and expected results, and what reporting tool you are using we can probably provide a working model.
0
 
LVL 15

Assisted Solution

by:Devinder Singh Virdi
Devinder Singh Virdi earned 250 total points
ID: 38807237
Syntax:

select col1, col2, sum(col3) from table
Where Col3 <> condition_1
group by Col1, col2
having count(*) > condition_2

In your statement, group by statement is missing.
0
 

Author Closing Comment

by:conardb
ID: 38807364
Thanks
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question