Issue with not a single-group group function error

Hello PL/SQL Gurus,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version and
Once I am using the following query –
SELECT s.sym,
t.tag_trade_method trade_method,
astd.tag_trade_sector,
iss.gics_sector_dsc sector,
d.date_dt trade_date,
c.wmc_curcy_cd_alpha curcycode,
amd.brkr_nm,
SUM(atdf.notional_amt) trd_notional,
SUM(atdf.trd_qty) trd_qty,
ard.buy_sell_ind,
td.person_init
FROM alloc_tran_det_fact atdf,
date_dim d,
alloc_trade_tag_dim t,
security_dim s,
currency_dim c,
person_dim td,
access_method_dim amd,
alloc_sec_tag_dim astd,
alloc_ref_dim ard,
issuer_dim iss
where atdf.alloc_trd_tag_dim_key = t.alloc_trade_tag_dim_key AND
atdf.alloc_sec_tag_dim_key = astd.alloc_sec_tag_dim_key AND
ard.alloc_ref_dim_key = atdf.alloc_ref_dim_key AND
atdf.isr_dim_key = iss.isr_dim_key AND
atdf.trd_dt_key = d.date_dim_key AND
atdf.sec_dim_key = s.sec_dim_key AND
t.tag_valid_trade_flg = 'Y' AND
atdf.locl_curcy_flg = 'Y' AND
d.date_dim_key BETWEEN 20120405 AND 20120405 AND
c.curcy_dim_key = atdf.curcy_dim_key AND
td.person_dim_key = atdf.trdr_dim_key AND
atdf.exec_brkr_dim_key = amd.access_method_dim_key AND
amd.level_cd = 'B'
and t.tag_trade_method in('ALGO','CAPITAL','DMA','NATURAL','WORKING')
then it throw the error –
ORA-00937: not a single-group group function
If I am using something like –
SELECT s.sym,
t.tag_trade_method trade_method,
astd.tag_trade_sector,
iss.gics_sector_dsc sector,
d.date_dt trade_date,
c.wmc_curcy_cd_alpha curcycode,
amd.brkr_nm,
SUM(atdf.notional_amt) trd_notional,
SUM(atdf.trd_qty) trd_qty,
td.person_init
FROM alloc_tran_det_fact atdf,
date_dim d,
alloc_trade_tag_dim t,
security_dim s,
currency_dim c,
person_dim td,
access_method_dim amd,
alloc_sec_tag_dim astd,
issuer_dim iss
WHERE atdf.alloc_trd_tag_dim_key = t.alloc_trade_tag_dim_key AND
atdf.alloc_sec_tag_dim_key = astd.alloc_sec_tag_dim_key AND
atdf.isr_dim_key = iss.isr_dim_key AND
atdf.trd_dt_key = d.date_dim_key AND
atdf.sec_dim_key = s.sec_dim_key AND
t.tag_valid_trade_flg = 'Y' AND
atdf.locl_curcy_flg = 'Y' AND
d.date_dim_key BETWEEN 20120102 AND 20120401 AND
c.curcy_dim_key = atdf.curcy_dim_key AND
td.person_dim_key = atdf.trdr_dim_key AND
atdf.exec_brkr_dim_key = amd.access_method_dim_key AND
amd.level_cd = 'B'
and t.tag_trade_method in('ALGO','CAPITAL','DMA','NATURAL','WORKING')
GROUP BY t.tag_trade_method,
d.date_dt,
c.wmc_curcy_cd_alpha,
td.person_init,
amd.brkr_nm,
astd.tag_trade_sector,
iss.gics_sector_dsc
then it works fine. I know that due to aggeregate functions we need to use Group By, but why to put Group By on different non aggregate columns,
As my intension is to fetch the records for defined date range Group By Symbol (s.sym), Kindly help me with this. 
Thanks to all of you in advance for providing you valuable time and efforts.
Edited by: user555994 on May 11, 2012 2:20 AM

You do need to group by these columns
t.tag_trade_method,
d.date_dt,
c.wmc_curcy_cd_alpha,
td.person_init,
amd.brkr_nm,
astd.tag_trade_sector,
iss.gics_sector_dsc
as they don't have aggregate functions applied to them.

Similar Messages

  • Help with 'not a single-group group function' error

    I have the following statement which gives me that error and don't know what's wrong.
    select BUDGET_CODE,
    to_char(sum(HOURS + (MINUTES/60) + OVERTIME_HOURS + (OVERTIME_MINUTES/60)+(sum(stat)/count(distinct BUDGET_CODE)) * WAGE),'L999999999.00') as Cost
    from KTT_INFORMATION i
    inner join KTT_WAGES w on i.NAME = w.NAME
    GROUP BY BUDGET_CODE
    The statement was working and I added:
    +(sum(stat)/count(distinct BUDGET_CODE))
    which works in a separate statement of its own. Any help is appreciated.

    Although, if you're doing a count on BUDGET_CODE while at the same time grouping by that same field, you'll always get a 1 back from count() in this query, so you may need to modify that anyway.

  • Not a single-group group function very urgent

    HI,
    select sum(avg(wait_to))+sum(avg(idle))+sum(avg(users))+sum(avg(system)) from system_cpu
    where hostid='DSCP02469' group by cpuid
    this query is working
    but i want cpuid group to be displayed
    so i wrote query like this.
    select cpuid,sum(avg(wait_to))+sum(avg(idle))+sum(avg(users))+sum(avg(system)) from system_cpu
    where hOstid=' ' group by cpuid it is throwing a error
    not a single-group group function.
    how can get sum of avg of colums,column based on some coloum
    group by column
    id,sum(avg( )) i have to get
    please give me solution.
    send me mail to [email protected]

    hi,
    thanku for immediate reply but
    if i do that
    select cpuid, a+b+c+d total_value from (select cpuid,
    sum(avg(wait_to)) a, sum(avg(idle)) b,sum(avg(users)) c,sum(avg(system)) d
    from system_cpu where hostid='DSCP02469' group by cpuid)
    SQL> /
    select cpuid, a+b+c+d total_value from (select cpuid,
    ERROR at line 1:
    ORA-00937: not a single-group group functionelse
    select cpuid, a+b+c+d total_value from (select
    sum(avg(wait_to)) a, sum(avg(idle)) b,sum(avg(users)) c,sum(avg(system)) d
    from system_cpu where hostid='DSCP02469' group by cpuid)
    SQL> /
    select cpuid, a+b+c+d total_value from (select
    ERROR at line 1:
    ORA-00904: "CPUID": invalid identifier2)
    can we use select in select case
    can we use select sal, case when sal then select * from emp like this
    with regards
    shannu sarma

  • ORA-00937:not a single-group group function|ORA-06512:at"schema.procedure n

    ORA-00937:not a single-group group function|ORA-06512:at"schema.procedure name)?
    The details of this procedure are the emp table is used in the emp1 which is shown in line 19
    1 DECLARE
    2 cur_emp sys_refcursor;
    3 TYPE t_tab IS TABLE OF emp%ROWTYPE;
    4 tt t_tab;
    5 cur_emp1 sys_refcursor;
    6 TYPE t1_tab IS TABLE OF emp1%ROWTYPE;
    7 tt1 t1_tab;
    8 BEGIN
    9 OPEN cur_emp FOR
    10 SELECT c1,c2,c3 FROM t1,t2,t3 where t1.c1=t2.c2 and t1.c1=t3.c3;
    11 LOOP
    12 FETCH cur_emp BULK COLLECT INTO tt LIMIT 100000;
    13 EXIT WHEN tt.COUNT=0;
    14 FOR i IN 1..tt.COUNT LOOP
    15 insert in to emp (c1,c2,c3) values (tt(i).c1,tt(i).c2,tt(i).c3;
    16 END LOOP;
    17 END LOOP;
    18 OPEN cur_emp FOR
    19 SELECT c11,c12,c13 FROM emp,t12,t13 where emp.c11=t12.c12 and t11.c11=t13.c13;
    20 LOOP
    21 FETCH cur_emp1 BULK COLLECT INTO tt1 LIMIT 100000;
    22 EXIT WHEN tt1.COUNT=0;
    23 FOR j IN 1..tt1.COUNT LOOP
    24 insert in to emp1 (c11,c12,c13) values (tt1(j).c11,tt1(j).c12,tt1(j).c13;
    25 END LOOP;
    26 END LOOP;
    27 END;
    /

    ORA-00937:not a single-group group function|ORA-06512:at"schema.procedure name)?
    The details of this procedure are the emp table is used in the emp1 which is shown in line 19
    1 DECLARE
    2 cur_emp sys_refcursor;
    3 TYPE t_tab IS TABLE OF emp%ROWTYPE;
    4 tt t_tab;
    5 cur_emp1 sys_refcursor;
    6 TYPE t1_tab IS TABLE OF emp1%ROWTYPE;
    7 tt1 t1_tab;
    8 BEGIN
    9 OPEN cur_emp FOR
    10 SELECT c1,c2,c3 FROM t1,t2,t3 where t1.c1=t2.c2 and t1.c1=t3.c3;
    11 LOOP
    12 FETCH cur_emp BULK COLLECT INTO tt LIMIT 100000;
    13 EXIT WHEN tt.COUNT=0;
    14 FOR i IN 1..tt.COUNT LOOP
    15 insert in to emp (c1,c2,c3) values (tt(i).c1,tt(i).c2,tt(i).c3);
    16 END LOOP;
    17 END LOOP;
    18 OPEN cur_emp FOR
    19 SELECT c11,c12,c13 FROM emp,t12,t13 where emp.c11=t12.c12 and emp.c11=t13.c13;
    20 LOOP
    21 FETCH cur_emp1 BULK COLLECT INTO tt1 LIMIT 100000;
    22 EXIT WHEN tt1.COUNT=0;
    23 FOR j IN 1..tt1.COUNT LOOP
    24 insert in to emp1 (c11,c12,c13) values (tt1(j).c11,tt1(j).c12,tt1(j).c13);
    25 END LOOP;
    26 END LOOP;
    27 END;

  • Having issues with contacts... groups specifically... when I add contacts to a group and check back there are fewer in group than when i started.. they disappear??

    having issues with contacts... groups specifically... when I add contacts to a group and check back there are fewer in group than when i started.. they disappear??

    Hi
    in this scenarion control is not going inside the condition
    if (vo.getRowCount() == 0) and therefore VO is not getting initialized
    why u are counting the row of VO to initialize the VO ,if possible pls remove this condition check ,problem will be solved .pls let me know in case of any issues.
    thanx
    Pratap

  • I have been having issues with not receiving texts and voicemails daily, for a few months now. If I turn the phone completely off, when I turn it back on the messages will flood in from hours before. I can't be continually turning off my phone in case som

    I have been having issues with not receiving texts and voicemails daily, for a few months now. If I turn the phone completely off, when I turn it back on the messages will flood in from hours before. I can't be continually turning off my phone in case someone left me a message. How do I resolve this issue?

    Wifi:  my Cell phone will remember 10 wifi connections.  So delete any you don't use often and your home wifi and try to enter home wifi again.
    if it still won't connect to home wifi, call your internet provider for help.  You may need a newer router or different settings Or upgraded service.   Your phone seeks the best connection and will refuse lesser connections.
    last resort.  Backup the phone.  Do a full reset, then restore as new with the backup.
    if still not fixed, go back to apple and insist on repair or replacement.
    HOWEVER.   voicemail is not a wifi issue, it's a carrier function, which is why the SIM card is a suspect.

  • Having issue with update Adobe 11.0.06.  Error 1603.

    Having issue with update Adobe 11.0.06.  Error 1603.

    You should have gotten this information with the error: "Shut down Microsoft Office and all web browsers. Then, in Acrobat or Reader, choose Help > Check for Updates. See also Error 1603 | Install | CS3, CS4 products." Also, be sure you log in as the administrator and disable anti-virus.

  • Issues with Lion recognizing keyboard and mouse functions

    Hello everyone,
    I have read that there were issues with Lion so I waited for months before I upgraded hoping that there would be enough complaints to warrant a fix from the tech lords.  I decided to finally upgrade and the issues with incompatible software came to fruition.  Fortunately I don't need to upgrade anytime soon but here's my real issue.  I have a logitech mouse and keyboard and Lion won't recognize the keyboard, even with product upgrade.  Also, the right click button is not functioning the way it should.  I can no longer right click and copy and paster anymore.  Being a long time mac head from the 80s I know there are always issues but I have never experienced this many. Any suggestions?
    Thanks

    I had the same setup with the apple BT keyboard and the V270 mouse. I also work with the lid closed and with an external monitor (I bet that you are also using airport)! Both devices seem to intermittently loose connection, and the mouse cursor doesn't track very well. Looking through postings it seems that airport interferes with BT, and the behavior I've seen seems to support this. I stopped using the mouse because I couldn't get it to work adequately. I'v also tried using BT headphones (Motorola HT820) which at best the sound drops out intermittently, and at worse crashes OS X. I'm thinking that BT on the Macbook Pro just marginally works... I'd be curious if you ever had any success with your setup!

  • Does any1 hav issues with not being able to send pic from the camera roll. I've already had issues with over exposure that the new update fixed but it left me with this issue.

    Since getting my iPhone 5 I've had camera issues. To start with it was over exposure, the camera was flashing too early and leaving me with dark pictures. After a failed reset I visited the apple store, where they told me it was a known problem and apple were working on a update to fix the issue and it was just a
    waiting game. Once the update was available I did it immediately and the problem seemed to be fixed. I've now noticed that from the camera roll I carnt send a picture to mms. It gives me the option but the screen completely freezes after I've chosen it. The only way to access my camera roll again is to completely close the camera roll down and reopen it. The strange thing it it will let me send it as an email and upload taught to Facebook etc just not as an mms. The other strange thing is if I go to msgs and add a photo I'm successful but if I try to edit the photo I want to send 1st then I get the same issue as the camera roll. I also have issues with the shutter taking ages to open. Is anyone else havin these issue before I go back to the apple shop. A complete reset hasn't worked

    Photo Stream only handles images and your videos are not uploaded or shared with other devices.
    Use iPhoto to import from your device. It can bring in the videos and image files.

  • Has anyone had issues with not hearing the text alerts on the iPhone 5?

    hello i have been having issues with my iphone 5 not hearing the text alert tones.it will go from time to time & only hear the vibrating sound, The wired part is all other alerts work fine , just text. 
    Has anyone having this same issue ? Also i noticed sometimes when i text, i'll see some crazy blury lines go across my screen like as i text it will move across any help?

    I have had that issue with no text alert sound and also with calls, no ring for the call but then I got a missed call or voicemail alert. Never had the blurry lines though. Right after I upgraded, the ring changed to a very short version of what I have selected and only rang once, other times not at all. This was a very big problem since I am working from my car most of the day and get a lot of calls and texts.  I did a reset with home button and button on the top as described in a post somewhere here on the forum and the problems stopped. So far so good. Give reset a try!

  • Did this resolve my Safari 5 issue with not loading pages as fast?

    I've been having this problem every since I got my laptop a month ago... I have a wireless router that's connected to a PC, and I use wireless on my laptop. My old laptop was a PC, and the internet connection was just fine on it. However, I'm having issues with my MacBook Pro. When I first turned on my laptop after taking it out of the box, Airport detected my wireless router and connected me to the internet. Obviously, I used Safari 5 as my browser and although it works... it doesn't load the pages as fast as it should. It even stops loading at times. Usually, I quit Safari and reopen Safari and it works and if it doesn't, I click on the reload button or just keep re-opening Safari until it does work... buttt I am tired of doing that now. So after a lot of attempts by trial and error, I think I found the solution and was wondering if anyone could confirm this with me. I went to my router's IP address and I looked at the settings. I looked at the router's DNS settings and I copied and pasted that router setting into the DNS settings on my laptop for the wireless network. Now, my internet seems to be working... but then again it has only been 5 minutes. So my question is... the router's DNS has to match the wireless network's DNS address?
    Sorry if this sounds like a stupid question... I'm not an expert when it comes to internet, LAN, proxies, and etc. settings. Thank you!

    Further investigation has revealed that the following error message is being generated within Safari during the first time the that the page is loading,
    "Refused to load from document base URL. URL found within request."
    The <base> directive in the HTML, in this instance, is referring to a different URL than the one that the page is running from. The page with the problem is running on a remote server and back referencing to the home server for the <base> reference. This fails when the page first loads but seems to be accepted if a page-reload is done. It also works on all other browsers that have been tested.
    Is this related to a security setting in the browser?

  • Calendar invites issues with Notes invites

    I am having issues with invites from Lotus Notes.  The invites are coming marked as an hour later than they should be.  It would seem that the timezone (or perhaps the daylight savings time) settings are wrong and iCal is creating them an hour later than they should be.  We have tried specifying the timezone in the Notes account, but it still comes in wrong.
    Invites from other people (e.g. Outlook) are coming in correctly.
    Has anyone seen this before and do you know how I can resolve this?
    Thank you.

    I finally resolved this... by changing everything over to a new laptop.  I had been running iTunes on a Vista desktop, and moved Outlook and iTunes to a Win7 x64 laptop.  Once I got everything installed, I copied the iTunes folder to the laptop, transferred the purchases, backed up the iPhone and iPad to the new iTunes, and then synched them.  Set iTunes to sync Calendar, Contacts, Mail, and Notes on both, and resynched.  Once this was done and I verified that everything was intact on both the iPhone and the iPad, I tried entering a calendar event on the phone and then did another sync.  The event showed up in Outlook.  I then deleted the event from Outlook and did another sync and the event was gone from the iPhone.  Did the same with the iPad and got the same results.  So this apparently was something related to the desktop or Vista; I never got it resolved on the desktop.  Not sure what it could be, but now that it's resolved I'm going to leave it alone.  Maybe after I upgrade to an iPhone 5, I might try messing with the iPhone 4s on the Vista desktop.  If I do, and happen to get it resolved, I'll surely post something regarding that.

  • Does anybody have an issue with not hearing custom text tones on their Iphone 5?

    I am having a problem not hearing any custom text tones on my Iphone 5 even though it is not on silent mode.  It's very upsetting cuz friends will text me when I'm at work at my phone is in my pocket but I don't know until I look at my screen.  Never had this issue with my old Iphone 4 plus my WiFi seems to kind of suck to with reception.

    I have the same problem! I have been on the phone and emailing apple support for several days and still not working. They credited back my purchased text tones. I even repurchased a couple text tones and they work for a couple hours then it stops working. If I click on sounds under settings and try to just listen to the tone, all It does is vibrate

  • Issue With Notes for Approval

    Hi SRM Gurus,
    The problem we have with "Notes for Approval" at the bottom of SC is whenever some one adds a Note to this section it is not getting properly aligned for example see below for how finally all notes look like after Notes being added by Approvers
    Notes for Approval
    This is Notes Test3:
    This is the Note from :AOGRAN On 27.02.2008:
    FHANK On 02/26/2008:
    CBRITT On 02/26/2008:
    In the above CBRITT has added the first line "This is Notes Test3: " but the note is shown at the beginning and his ID and time stamp are at the bottom.
    Is there any way, both can be combined together in one line side by side ??

    Hi Swati,
    Looks like the template was modified beforw I started working on it.I compared the template code in dvelopment with previous version and found some lines were missing , copied the missing lines and now it is working fine.
    Thanks a lot for the help,
    Anubhav

  • HT1695 Anyone else having issues with not being able to get wifi on their iPhone 4S? I can't even switch the wifi button to try and connect to my wifi at home but my iPad still uses the wifi just fine.

    I can't even switch the wifi button to try and connect to my wifi at home but my iPad still uses the wifi just fine.

    Thank you, I am trying to last option now. Resetting my network settings and if that still doesn't work ill have to go in to the apple store. Hopefully I won't need a new phone because I'm already at my limit with replacements on my AppleCare even though the issue with the phones 3 out of 4 times wasn't my fault and I can't afford to buy another phone.

Maybe you are looking for

  • Do I have to run Apps in b/round? - How to "Close an App" quickly?

    1. Is there any way to "toggle off" background Apps? I have no need to keep newspapers, books, games, etc running in the back only to have to "Double tap the home button, hold the icon till it wiggles, tap the negative sign, close the bottom panel" -

  • ADF Library problem...

    Hi all, I hope someone can help me with this. I'm using JDeveloper 11.1.1.2 I have an application with three projects, two models and a view controller, I have business components (Entity Objects) in the first model project deployed to an ADF library

  • Every so many restarts, 10.9 hangs on boot. Must reinstall...

    I recently picked up a new Mac Mini 2.6 GHz i7. I put in two crucial SSD's and 16 GB of Crucial ram. Everything was working great. Until two weeks in my Mac would not boot on a restart. I eventually cloned my backup back on to the startup disk and ev

  • Prompt command misdisplay, 2 letters constantly displayed b4 command

    I run Arch Linux in VirtualBox. I use bash history. On first click a _long_ command is displayed. On next clicks, the first 2 characters of the _long_ command are constantly displayed on the screen followed by the next command in turn. If I press "en

  • Howto Link Down-Cable problem?

    Hi, I am having a Ultra Sparc 5 with a hme interface and a quad card. When the machine boots it checks at boot prom level all 5 interface and reports for all qfe interfaces "Link Down-Cable problem?". All qfe interfaces do not have a ethernet connx b