GROUP BY Not doing its job

Hey,
On running the following query
SELECT a."VISA_COUNTRY" AS "COUNTRY",
ROUND(((select COUNT("PSA_VISA_INFO"."VISA_EMP_ID") FROM "PSA_VISA_INFO", "PSA_RESOURCE_MANAGER" WHERE "PSA_VISA_INFO"."ACTIVE_FLAG" = 'Y' AND "PSA_RESOURCE_MANAGER"."ACTIVE_FLAG" = 'Y' AND "PSA_RESOURCE_MANAGER"."ROW_ID" = "PSA_VISA_INFO"."VISA_EMP_ID" AND "PSA_RESOURCE_MANAGER"."WORK_GROUP" = 2) /(SELECT COUNT("PSA_RESOURCE_MANAGER"."ROW_ID") FROM "PSA_RESOURCE_MANAGER" WHERE "PSA_RESOURCE_MANAGER"."ACTIVE_FLAG" = 'Y' AND "PSA_RESOURCE_MANAGER"."WORK_GROUP" = 2)*100),2)AS "PERCENT" FROM "PSA_VISA_INFO" a, "PSA_RESOURCE_MANAGER"
GROUP BY a."VISA_COUNTRY"
the output I am getting is
Country Percent
COUNTRY1 12.23
COUNTRY2 12.23
COUNTRY3 12.23
12.23 is the value that is returned when the query is run without the group by clause. However we need the percentage country wise...
furthermore this query did not initaill run and kept throwing up the error Invalid GROUP BY.. after adding another GROUP BY condition it started to show this output.. on removing the 2nd group by condition the same out is being given..
i also tried logging out of the application and logging in.. it is still giving the same output
Your inputs would prove invaluable right now ..
Thanks,

What happens if you make the select an inline view and then group off that? like:
SELECT country,
       PERCENT
  FROM (SELECT a."VISA_COUNTRY" AS "COUNTRY",
              ROUND(((SELECT COUNT("PSA_VISA_INFO"."VISA_EMP_ID")
                        FROM "PSA_VISA_INFO",
                             "PSA_RESOURCE_MANAGER"
                       WHERE "PSA_VISA_INFO"."ACTIVE_FLAG" = 'Y' AND
                             "PSA_RESOURCE_MANAGER"."ACTIVE_FLAG" = 'Y' AND
                             "PSA_RESOURCE_MANAGER"."ROW_ID" =
                             "PSA_VISA_INFO"."VISA_EMP_ID" AND
                             "PSA_RESOURCE_MANAGER"."WORK_GROUP" = 2) /
                    (SELECT COUNT("PSA_RESOURCE_MANAGER"."ROW_ID")
                        FROM "PSA_RESOURCE_MANAGER"
                       WHERE "PSA_RESOURCE_MANAGER"."ACTIVE_FLAG" = 'Y' AND
                             "PSA_RESOURCE_MANAGER"."WORK_GROUP" = 2) * 100),
                    2) AS "PERCENT"
         FROM "PSA_VISA_INFO" a,
              "PSA_RESOURCE_MANAGER")
        GROUP BY countryActually on second thought you really have a cartesian - why is PSA_RESOURCE_MANAGER in the from clause if you aren't joining it?

Similar Messages

  • Tecra M5 - Toshiba Power Saver not doing its job properly

    Hi,
    After looking for some time for a tool to silence my Tecra M5 I found a seemingly nice app called Toshiba Power Saver. Unfortunately this tool doesn't seem to be working properly. I played with the [Cooling Method slider|http://img200.imageshack.us/img200/8008/powersaver.jpg] (click to see an image) and here is how it works.
    The Cooling Method can be set to one of four options: Battery Optimized, Performance, Maximum Performance, and Cooling Optimized, where the first one is supposed to be the quietest, and the other ones more and more noisy.
    Let's assume that the cpu fan is initially spinning at a high speed and I'm not doing anything on my laptop. I move the slider to Battery Optimized setting, click on Apply and the fan (instantaneously) slows down (yay!). Then I need to do something power hungry for a moment and eventually the fan spins up to the noisy level. I then do nothing at all again but the fan stays like that *forever*. The cpu is as cold as ice, the air being blown out could freeze your fingers, but the fan is spinning like crazy waking up my neighbours across the road.
    Am I really sure the cpu is cool? Yes. Why?
    Because when I move the slider to Performance setting now and click Apply the fan slows down (right away) and stays like that until I start working on something again. Then I stop doing what I was doing and the fan keeps spinning *forever* again.
    So then I change the Cooling Method to Battery Optimized setting back again, click on Apply and the fan slows down.... and so on and so on, stuck in the vicious circle.
    The key to the success here is keeping pressing the Apply button, which the Power Saver application should be doing from time to time and not me, and not forgetting what it's here for.
    What's wrong with that app? Is there any fix available (or an alternative)?
    The version I have is 7.11 and runs under XP Pro SP3.

    Hi Feliks,
    Thank you for your reply. I have a Tecra M5 notebook not a Portege, though.
    Unfortunately I cannot agree with most of what you have said. Either there is something wrong or this software is just useless. It is quite unlikely that there is something wrong as I had exactly the same laptop before and it was as noisy. That to me would be too much of a coincidence.
    Before then I had a dual core notebook with Philips sticker on it (and that was all Philips's input) in even smaller enclosure (12") and no fancy software in it. In that laptop the fan was running once every several minutes while idle and as soon as it cooled down the cpu it stopped - a complete silence. And this is how it should be. I've just read a review of one HP laptop: "During normal use I almost never hear the hard drive or the fan. In fact the fan really only comes on when playing games." I'd like mine to be like that too.
    Here I play music in Winamp at the processor speed set to 1 (out of 6, lower means slower) and cooling set to a quiet setting (after help: "The system is cooled by slowing CPU speed, and the fan is started only when neccesary."), and after the fan starts it then never (I don't exaggerate here) stops spinning and eventually keeps blowing out cool air. The CPU usage varies between 0 and 5%. I mean, that's not normal to me. My phone can do the same job and it doesn't have a fan at all. Not to mention that Intel CPUs will not let themselve get fried. So why?
    I sold the mentioned Philips laptop to move on to some decent brand and I am *very* disappointed. It's a shame, as this particualar model would be perfect for me, I like everything about it, but the noise is just unbearable, it's embarassing to take this machine to a library. And the software... well, I will stop here and wait for some other Tecra M5 users to share their experience.
    In the meantime I'll try with Toshiba support, as you advised.
    Thanks!

  • JScrollPane does its job until I minimize the GUI...

    Im adding a JScrollPane onto a JTextArea which works fine and scrolls vertically when there are multiple lines of text. However, when I minimize the GUI, or switch from the current page to another (using some radio buttons), the ScrollPane isnt doing its job as the whole GUI container kind of 'stretches' to accomodate the multiple lines of text. Hope Im making sense!
    Im using TableLayout to add the JTextArea to another JPanel and the JScrollPane to that JPanel and onto the JTextArea, as shown below:
    panel7.add(dNameInvoiceAddressField, "0, 14, 1, 16, f, b");
    panel7.add(new JScrollPane(dNameInvoiceAddressField), "0, 14, 1, 16");
    Any help greatly appreciated.
    Thanks

    any ideas...?

  • I have a Mac OS X 10.6.7 and Firefox 4. Other browser are easily connecting to the net but Firefox. It keep trying to connect to my wireless network but not doing the job. Please give some advice..

    This happens when I first start the computer. Sometimes it connects to the wireless network, and during the day is fine.

    user8744713 wrote:
    I have downloaded Instant Client libraries (basic, SDK and SQL files, named instantclient-basic-10.2.0.4.0-macosx-x64.zip , instantclient-sqlplus-10.2.0.4.0-macosx-x64.zip and instantclient-sqlplus-10.2.0.4.0-macosx-x64.zip ) to Mac OS X 10.6.2 server and unzipped them as instructed in the manual here: http://download.oracle.com/docs/cd/B19306_01/install.102/e12121/inst_task.htm#BABJGGJH
    Manual then instructs to run runInstaller command. This command however is not being recognized by the system (' No such file or directory' error is thrown) which to my opinion means one of two things: either command is misspelled in the manual or the command file that runs it is missing. I tried it with or without a dot and slash and in small case letters, nothing works.
    When I installed similar libraries on Linux I had no problems but all was required there was to place libraries in the proper directory, no command was required.
    Maybe same can be done here as well but I am not sure where to place some of the files. I see .h files that should go to /usr/include but see no .so files that on Linux go to /usr/lib. There are some files with .dylib and other .*lib extensions but I'm not sure if they should be copied to /usr/lib or not. And then there are some other files I have no idea what to do with.
    Please help!!!No, you can't just drop a few files into a directory and have a working installation (well, I guess technically you could. But technically you could bail all the water out of Lake Superior with a teacup ...)
    Sounds like you've covered PATH and current directory issues. What about permissions? What OS account are you using for this installation? (you should have created an account called "oracle" and made it's primary group "dba"). Does that account have execute permissions?
    >
    Thanks in advance!
    Edited by: user8744713 on Mar 26, 2010 10:17 AM

  • Safari bookmarks lost - Time Machine not doing his job ?!?!

    I recently made a clean install of my system (10.6.6). I backed up everything before, did it again to make sure it was really backed up, and then I inserted the DVD.
    Now back in OS X, I wanted to take my bookmarks from my back up. I know where they are /user/Library/Safari/bookmarks.plist
    The thing is that this bookmark file is like a couple of days old. There are bookmarks that should be there that aren't ! Same thing with the history.plist file : I looked at it while thinking of the last websites I went to before doing the back ups and these websites aren't there too !
    What's wrong with Time Machine ? I ******* hate it when machines don't do there job correctly.
    Is there a place where these missing bookmarks might be ? Or should I start using something else than Time Machine ? Where's the problem ?
    Thanks in advance.
    (edit: sorry, wrong subforum : this belongs in the Mac OS X v10.6)
    Message was edited by: jeremu19

    You might have been bitten by a fairly rare but long-known bug in Snow Leopard. See the yellow box in #D5 of [Time Machine - Troubleshooting|http://web.me.com/pondini/Time_Machine/Troubleshooting.html] (or use the link in *User Tips* at the top of this forum).
    Probably no way to tell at this late date whether that was the cause or not.

  • Why can't we disable auto-reloading without having the nag bar every time it does its job?

    Blocking page reloading (or auto-refresh) and being "warned" about a blocked page reload, should be two, separate items in Prefs, or config. Period. If someone wants to be "alerted" or "warned" every time their settings are acted-upon, so be it, they can choose to be warned. As it stands, the only way to block the annoying auto-refresh, is to choose the annoying nag.
    Where is the logic in that? What next? Maybe we should have an alert every time a new tab or window opens, that says, "Firefox just loaded a page you requested."
    Why not follow the structure, already established, over and over, in Firefox's preferences, whereby a user can make one choice, and then there are sub-items that can also be chosen, or not chosen? (i.e., 1-Accept cookies from sites (check, or no check), a) Accept third-party cookies (select from Always, From-visted, or Never)?

    hello, this is a primarily community-run support forum so it's probably not the right place to request features (we cannot implement any features & devs won't read here).
    please either use https://input.mozilla.org/feedback for general feedback or if you feel that it's a missing feature in the browser file a bug at bugzilla.mozilla.org.

  • Bt not doing their job properly!!!!!!!!!

    I am absolutely appalled at the poor level of service I have received since joining BT. From BT cancelling my contract in error, having to wait 2+ months, plus many phone calls, for the line rental refund that was not received in full. AND I had to pay AGAIN for 12 months line rental while we were waiting for the previous to be refunded, before I could start the process again. To them not contacting my previous broadband supplier to stop our contract with them. So I have been billed twice for the same period. 
    I contacted BT regarding this a couple of months ago and obviously nothing was done about it as today I received a letter from a debt collection service to say the debt ( £19.40 ) has been handed over to them!!! I have paid the bill as it isn't their fault but it has left me very angry that this is another thing I have to chase BT for!!! 
    Money leaves my account every month and I don't know what it is for as since the 1st bill, I haven't received another. And I say the 1st bill...that was during the period that they accidentally cancelled so I shouldn't have been billed at all! Bt were contacted and I was assured the bill would be cancelled...it wasn't and money was taken from my account. At that point I was pretty fed up but thought what's the point in phoning again as nothing would get done about it but I cannot leave this new matter.
    I would like BT to refund the money I had to pay to my previous supplier and to come up with a better customer care system. A call centre in the UK would be helpful.
    THank you

    Hi chunky
    You'd be better off contacting the mods on this contact form - http://bt.custhelp.com/app/contact_email/c/4951
    They can review the account notes and hopefully sort this out for you
    Allow up to 72 hours for a reply
    Let us know how it all goes
    -+-No longer a forum member-+-

  • Job Cancelled with an error "Data does not match the job def: Job terminat"

    Dear Friends,
    The following job is with respect to an inbound interface that transfers data into SAP.
    The file mist.txt is picked from the /FI/in directory of the application server and is moved to the /FI/work directory of application server for processing. Once the program ends up without any error, the file is moved to /FI/archive directory.
    The below are the steps listed in job log, no spool is generated for this job and it ended up with an error "Data does not match the job definition; job terminated".Please see below for more info.
    1.Job   Started                                                                               
    2.Step 001 started (program Y_SAP_FI_POST, variant MIST, user ID K364646)                           
    3.File mist.txt copied from /data/sap/ARD/interface/FI/in/ to /data/sap/ARD/interface/FI/work/.
    4.File mist.txt deleted from /data/sap/ARD/interface/FI/in/.                                   
    5.File mist.txt read from /data/sap/ARD/interface/FI/work/.                                    
    6.PD-DKLY-Y_SAP_FI_POST: This job was started periodically or directly from SM36/SM37 (Message Class: BD, Message Number : 076)  
    7.Job PD-DKLY-Y_SAP_FI_POST: Data does not match the job definition; job terminated (Message Class : BD, Message No. 078)    
    8.Job cancelled after system exception
    ERROR_MESSAGE                                                
    Could you please analyse and come up about under what circumstance the above error is reported.
    As well I heard that because of the customization issues in T.Code BMV0, the above error has raised. 
    Also please note that we can define as well schedule jobs from the above transaction and the corresponding data is stored in the table TBICU
    My Trials
    1. Tested uplaoding an empty file
    2. Tested uploading with wrong data
    3. Tested uploading with improper data that has false file structue
    But failed to simulate the above scenario.
    Clarification Required
    Assume that I have defined a job using BMV0. Is that mandatory to use the same job in SM37/SM36 for scheduling?
    Is the above question valid?
    Edited by: dharmendra gali on Jan 28, 2008 6:06 AM

    Dear Friends,
    _Urgent : Please work on this ASAP _
    The following job is with respect to an inbound interface that transfers data into SAP.
    The file mist.txt is picked from the /FI/in directory of the application server and is moved to the /FI/work directory of application server for processing. Once the program ends up without any error, the file is moved to /FI/archive directory.
    The below are the steps listed in job log, no spool is generated for this job and it ended up with an error "Data does not match the job definition; job terminated".Please see below for more info.
    1.Job Started
    2.Step 001 started (program Y_SAP_FI_POST, variant MIST, user ID K364646)
    3.File mist.txt copied from /data/sap/ARD/interface/FI/in/ to /data/sap/ARD/interface/FI/work/.
    4.File mist.txt deleted from /data/sap/ARD/interface/FI/in/.
    5.File mist.txt read from /data/sap/ARD/interface/FI/work/.
    6.PD-DKLY-Y_SAP_FI_POST: This job was started periodically or directly from SM36/SM37 (Message Class: BD, Message Number : 076)
    7.Job PD-DKLY-Y_SAP_FI_POST: Data does not match the job definition; job terminated (Message Class : BD, Message No. 078)
    8.Job cancelled after system exception
    ERROR_MESSAGE
    Could you please analyse and come up about under what circumstance the above error is reported.
    As well I heard that because of the customization issues in T.Code BMV0, the above error has raised.
    Also please note that we can define as well schedule jobs from the above transaction and the corresponding data is stored in the table TBICU
    My Trials
    1. Tested uplaoding an empty file
    2. Tested uploading with wrong data
    3. Tested uploading with improper data that has false file structue
    But failed to simulate the above scenario.
    Clarification Required
    Assume that I have defined a job using BMV0. Is that mandatory to use the same job in SM37/SM36 for scheduling?
    Is the above question valid?

  • Error on deleting page group (Path ID does not exist)

    Hello
    I'd like to delete a page group of my project. Normally I have no problem with that. But sometimes the following exception is thrown and the group can not be deleted:
    An unexpected error has occurred (WWS-32100)
    ORA-1: User-Defined Exception (WWC-36000)
    An unexpected error occurred: User-Defined Exception (WWC-44082)
    An unexpected error occurred: User-Defined Exception (WWC-44082)
    An unexpected error occurred: User-Defined Exception (WWC-44082)
    Error while deleting page. (WWC-44130)
    Path ID does not exist. (WWC-50001)
    Can anybody help me?
    Chrigel

    hi chrigel,
    i searched for the problem and found a few references to it in our bug database. i strongly suggest to open a TAR with support to analyze the problem. they will see if a patch is available for this problem or open a new bug.
    thanks,
    christian

  • Background Job cancelling with error Data does not match the job definition

    Dear Team,
    Background Job is getting cancelled when I run a Job on periodically but the same Job is executing perfectly when I run it manually(repeat scheduling) .
    Let me describe the problem clearly.
    We have a program which picks up files from an FTP server and posts the documents into SAP. We are scheduling this program as a background Job daily. This Job is running perfectly if the files contain no data. But if the file contains data the JOb is getting cancelled with the following messages.
    And also the same Job is getting executed perfectly when repeat scheduling is done ( even for files with data).
    Time     Message text                                                                       Message class Message no. Message type
    03:46:08 Job PREPAID_OCT_APPS2_11: Data does not match the job definition; job terminated        BD           078          E
    03:46:08 Job cancelled after system exception ERROR_MESSAGE                                      00           564          A
    Please help me in resolving this issue.
    Thanks in advance,
    Sai.

    hi,
    If you have any GUI function modules used in the program of job
    you cannot run it in background mode.

  • Regarding "Data does not match the job definition; job terminated"

    Dear Friends,
    The following job is with respect to an inbound interface that transfers data into SAP.
    The file mist.txt is picked from the /FI/in directory of the application server and is moved to the /FI/work directory of application server for processing. Once the program ends up without any error, the file is moved to /FI/archive directory.
    The below are the steps listed in job log, no spool is generated for this job and it ended up with an error "Data does not match the job definition; job terminated".Please see below for more info.
    1.Job Started
    2.Step 001 started (program Y_SAP_FI_POST, variant MIST, user ID K364646)
    3.File mist.txt copied from /data/sap/ARD/interface/FI/in/ to /data/sap/ARD/interface/FI/work/.
    4.File mist.txt deleted from /data/sap/ARD/interface/FI/in/.
    5.File mist.txt read from /data/sap/ARD/interface/FI/work/.
    6.PD-DKLY-Y_SAP_FI_POST: This job was started periodically or directly from SM36/SM37 (Message Class: BD, Message Number : 076)
    7.Job PD-DKLY-Y_SAP_FI_POST: Data does not match the job definition; job terminated (Message Class : BD, Message No. 078)
    8.Job cancelled after system exception
    ERROR_MESSAGE
    Could you please analyse and come up about under what circumstance the above error is reported.
    As well I heard that because of the customization issues in T.Code BMV0, the above error has raised.
    Also please note that we can define as well schedule jobs from the above transaction and the corresponding data is stored in the table TBICU
    My Trials
    1. Tested uplaoding an empty file
    2. Tested uploading with wrong data
    3. Tested uploading with improper data that has false file structue
    But failed to simulate the above scenario.
    Clarification Required
    Assume that I have defined a job using BMV0. Is that mandatory to use the same job in SM37/SM36 for scheduling?
    Is the above question valid?

    Hi dharmendra
    Good Day
    How are you
       I am facing the same problem which you have posted
    By any chance have you got the soultion for this
    If so please let me know the solution for this.
    Thanks in advance.
    Cheers
    Vallabhaneni

  • Scroll bar does not retain its position after or before pack

    Hi
    My Scroll bar does not retain its position after pack in my application.
    But i need to retain its state.
    My code snippet is :
    System.out.println("VAlue--->" + getHXValue());
    scrollPane.getHorizontalScrollBar().setValue(getHXValue());
    pack();
    My VAlue printed is 100.
    But my positon of scroll bar is at 0 th location.
    Can any one help me.....

    Swing related questions should be posted in the Swing forum.
    My code snippet is :Snippets don't help.
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • I came home and i came home and my iphone is now frozzen on the applmy iphone is now frozzen on the apple screen and it hasnt been doing anything i put it in the charger and its not doing anything how do i get it to work so i can  text and call and stuff

    i came home and my iphone is now frozzen on the apple screen and it hasnt been doing anything i put it in the charger and its not doing anything how do i get it to work so i can  text and call and stuff

    I got to that page but clicking on the Subscribe Free had no effect.
    Nothing showed in the Podcasts nor the iTunes U.
    In fact I also subscribed to Stanford's lectures and despite actually managing to DL them there is still no subscription in iTunes U, just the Intro to Computer Science belatedly.
    Peter
    I'd like to attach the screen grab of the out of order and randomly DLed selection of Harvard's course, but the forum won't let me attach it even though it is only 456k. Correction, close post and retry and now it lets me. NB how intermittent the DLs are and in no particular order.

  • What does the usb pointing to itunes symble mean. i have reset and it will not do anything but shoe that on the screen. I have it plugged in to itunes and its not doing anything?

    What does the usb pointing to the itunes symble mean? its frozen on that screen, i plugged it in to itunes but its not doing anything

    Hello crysta33,
    Thanks for using Apple Support Communities.
    The screen with an iTunes logo and cord indicates the device is in recovery mode, and will need to be restored by using iTunes.  Take a look at the articles below for more information.
    If you can't update or restore your iPhone, iPad, or iPod touch
    Use iTunes to restore your iOS device to factory settings
    Take care,
    Alex H.

  • AP Group VLAN "Feelgood" does not exists on controller.

    Hi,
    While appling tenplates from WCS, i getting status report error message AP Group VLAN "Feelgood" does not exists on controller.
    I have double  checked the perticular AP group WLAN is created & mapped to the correct interface in the controller. This is not first AP group created on the controller, other AP groups are working on the same controller.
    Is there any Bug?
    Thanks

    Typically you still need to make sure that the country codes are indeed configured on the WLC. Thing can change when you upgrade code as standards might of changed and regulations also. If your AP's are functional, then you should be okay and I wouldn't worry too much about it, but if after the upgrade, the WLC complains about country code stuff, then you just need to verify that the AP's country code is defined on the WLC. May times the AP will not join and if it does join, the radios might be disabled or in a down status.
    Sent from Cisco Technical Support iPad App

Maybe you are looking for

  • Time Machine worked- with caveats- but worked

    Ok, TIme Machine rocks! I screwed with some applications, I tried to make the dock and desktop my own and F'd things up. What I was trying to do was to create stacks in doc. I wanted stacks for apple apps, stacks for business apps, stack for art, and

  • Lightroom 2.6 Keyword issues

    Hello everybody, I've got a big problem within lightroom (2.6). In my keyword list, when i select a keyword (to see the photos with that keyword) all my photos in the catalog pops up. For example there is a keyword with 4 photos in it. When i click i

  • Yellow status in front of idoc

    What means yellow status in front of idoc . (Green means it is processed, Red means it is in error). Where to find reason it is yellow

  • Does restoring your iPod solve the problem with the updater?

    I have a fourth generation iPod and I downloaded the 10-12-2005 updater. Since then my click wheel will not work, but all the buttons on my iPod still work. I have looked through the discussions and many other people have this same problem, but i hav

  • Yosemite upgrade preparation

    I am preparing to upgrade to yosemite.  Should I upgrade iphoto before or afterwards?  I have Snow Leopard and iphoto 8.1.2 which I gather will not be useable on yosemite.