Group by making difference in result when only when ID is selected.

The following query returns nothing since there is no data matching criteria in tables which looks good to me:
SELECT SUM (ci.premium_amt),'START PROGRAM'
FROM hr.group cg,
hr.request pi,
hr.rate ri,
hr.info cc,
hr.allocation ci,
hr.index fi
WHERE cg.product_id = 555
AND cg.r_id = 222
AND cg.product_id = pi.product_id
AND cg.r_id = pi.r_id
AND pi.product_id = ri.product_id
AND pi.r_id = ri.r_id
AND cg.group_id = cc.group_id
AND cc.cost_id = ci.cost_id
AND cc.index_id = fi.index_id
group by  cg.product_id;
But when i remove the group by clause in the above query as follows:
SELECT SUM (ci.premium_amt),'START PROGRAM'
FROM hr.group cg,
hr.request pi,
hr.rate ri,
hr.info cc,
hr.allocation ci,
hr.index fi
WHERE cg.product_id = 555
AND cg.r_id = 222
AND cg.product_id = pi.product_id
AND cg.r_id = pi.r_id
AND pi.product_id = ri.product_id
AND pi.r_id = ri.r_id
AND cg.group_id = cc.group_id
AND cc.cost_id = ci.cost_id
AND cc.index_id = fi.index_id
I get output as:
(null) START PROGRAM
I was expecting output as nothing as that id does not exist.
Help is appreciated.

user10857924 wrote:
since there are no rows produce, group by retrun nothing i.e. no rows to group by
where as when you apply aggregate function i.e. min/max etc without group it tends to produce atmost one rows even there is no row return
please look at below example hope this will clarify
with t(id, amt) as
     select 1, 10 from dual union all
     select 1, 10 from dual union all
     select 2, 30 from dual
select sum(amt), 'Total'
from t where id=99
with t(id, amt) as
     select 1, 10 from dual union all
     select 1, 10 from dual union all
     select 2, 30 from dual
select sum(amt), 'Total'
from t where id=99
group by id
Thanks
Edited by: user10857924 on Sep 21, 2010 3:35 PMI am getting the following error:
SQL> with t(id, amt) as
2 (
3 select 1, 10 from dual union all
4 select 1, 10 from dual union all
5 select 2, 30 from dual
6 )
7 select sum(amt), 'Total'
8 from t where id=99;
with t(id, amt) as
ERROR at line 1:
ORA-32033: unsupported column aliasing

Similar Messages

  • Result Processing - Additional results work only when any of the "Output Name" Enabled

    Only if i   ENABLE  any result type  only then the SequenceFilePostResultListEntry    is called
    the thing is I have aditional results & I save them in TDM format
    hence I dont need  the options from the   Result processing  
    is this  functional behaviour  expected from   teststand

    Hello aparab,
    i have greated a StationGlobals ReportActivated and fill this global in the callback
    ReportOptions with the the flag, if the report generation is disabled or not.
    In the SequenceFilePostResultListEntry a if structure is insert that ckecks the flag.
    Hope this helps.
    best regards
    Alexander Glasner
    AE NIE
    Attachments:
    SequenceFilePostResultListEntry.seq ‏11 KB

  • MacBook Pro w/ Retina Display 15-inch 2012 making strange cricket-like noise (only when plugged in)

    Hi guys, I have a year old retina MBP. Recently, it just started making this high-pitched whirring cricket-like sounds. Although pretty quiet, the sound is pretty annoying. This sound has a few strange characteristics that make it hard for me to pin it down to any component:
    - the sound only occurs when laptop is PLUGGED IN, when my laptop is not plugged (on battery), there is no sound
    - reducing the screen brightness, reduces the sound but does not make it go away (even with no backlight, the sound is still there)
    - the sound occurs mostly when performing going into MISSION CONTROL or swiping between desktops. It also sometimes happens randomly, but that is less common. It follows the inputs of trackpad and keyboard, though mostly mission control swipes and desktop changes. It doesn't coincide with intensive CPU, GPU, RAM or SSD tasks (ie running a CPU/GPU heavy app, or compressing a file does not increase the quantity of sound)
    - I am not very sure where the sound originates from, might be from the top left of the keyboard (q key), but it is also louder near the speakers.
    ALSO:
    - It is not from the fans, as they occur when fans are running slow or fast and this sound is unaffected by any changes in fan speed
    - reducing backlight has no effect
    - turning automatic graphic off or on has no effect
    - resetting NVRAM, etc. has no effect
    Most likely theory:
    - some kind of faulty capacitor maybe?
         - but then which part of the laptop to replace....
    - I don't have Applecare, but I do have a third-party warranty; they've agreed to replace the faulty part...
    - I've read the forums and have seen people with similar problems (though never this exactly; replacing fans and logic board does not seem to help)

    guiparent,
    whether it’s worth the price or not is an entirely subjective opinion. My own choice was to buy a used non-Retina 13-inch Mid 2010 MacBook Pro, and replace its hard drive with a SSD; but since I don’t use graphic-intensive apps such as the Adobe Creative Suite, my own choice would most likely not be best for you. Given your graphic design background, if you find the non-Retina displays sufficient for your needs, I’d recommend that you consider a used 15-inch Mid 2012 MacBook Pro. That model has memory sockets, so you can replace/upgrade the RAM if needed; its internal disk can be replaced by/upgraded with any 2.5-inch 9.5-mm-high SATA hard disk or SSD; and it has a built-in SuperDrive.

  • When I compose an email it flies up the screen when I press the shift key. I've clicked default settings on Keyboard in Preferences but it has made no difference.  It has only just started happening.

    When I compose an email it flies up the screen when I press the shift key and then comes back again. I've clicked default settings on Keyboard in Preferences but it has made no difference.  It has only just started happening.  Any ideas?

    This problem has also been plaguing me today. Here are my specifics and how I solved it (Expanding on what Quentin Holmes mentioned)
    CONFIRMED WORK AROUND! The .m4v file gets created while encoding, but Adobe Media Encoder does not re-pack it back into the .mp4 unless you select the "Export Audio" in Adobe Premier export prior to queuing. If you don't want audio, mute the individual tracks and still export audio.
    My details:
    Just bought a GH4, shooting 4k 25fps MOV, trying to simply trim a few clips and export them as H.264 .mp4 with no audio. (By the way it would be nice if we could export 4k .MOV files from the camera back into .MOV once finished editing, but in premier that frame resolution is not supported)
    Specs: Mac Mini, Quad Core i7, 16GB Ram, OSX 10.9.4, Adobe Premier Pro CS6 6.0.5, Adobe Media Encoder 6.0.2.81
    Hope that helps anyone with the same prob

  • Internet connection only when making a phone call

    I own a Powerbook G4, I connect to the internet wireless via aiport. I can connect only when making a phone call, my ISP is virgin.net. I've changed the micro-filter. Can any one help me on this problem.
    Thanks
    Lee

    Thanks for the usefull information, I've contacted BT they are my telephone provider here in the UK, and they did a line test, not a mechanical test as by an engineer, and said the line is OK. My in-comming & out-going calls are fine, but with interference on the line. How did you get past this problem?

  • How to display group data only when the particular group is clicked

    Hi frnds,
    I want to design my report as follows:
    Data is grouped by country, and for each country it is showing details for that country. I need to find out a way to display all group names first.  E.g.
    Argentina
    Aruba
    Australia
    And on click of particular country name it should display its details below it
    e.g.
    -Argentina
         BBB            Mendoza          123456
    +Aruba
    +Australia
    Has anyone done that before??? Is it possible to achieve it through Crystal Report Designer (2008)?? If yes then how???
    A prompt reply would be appriciated as i need this information urgently.
    Thanx.

    Thanx Jehanzeb,
    The sample u suggested did not solve my problem since it is opening the group data in new window.
    My question is - can we show/hide group data by clicking on that particular group (under that group name).
    e.g.
    ->(initial display - only groups)
    + Australia
    + America
    + Bhutan
    ->(on clicking a group)
    + Australia
    \- America
    abc    xyx    12213213    wqe9090
    dsd    dcv     90eur90e    ifjjdioifdoi
    + Bhutan
    In short, I am looking for on-demand display of records grouped by some field and the expansion of data must be done in the same page.
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:44 PM
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:45 PM
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:46 PM

  • How to enable a button only when a tilelist item is selected

    Simple question but it seems quite awkward to me. How do I enable a button only when an item within a tilelist is currently selected?
    For example lets say if I have a button called button1 that is disabled by default and a tilelist called tilelist1 what would I have to add into the brackets of the following code (enabled property of the button) to ensure that the button is only enabled when an item in the tilelist is currently selected but disabled when no items are selected:-
    enabled="{}"

    enabled="{tilelist1.selectedItem}"
    that should do it, it's making an implicit comparision with null (tilelist1.selectedItem == null) which will result in a boolean.
    SelectedItem is null when nothing is selected , not null when something is.

  • Start automatically an action only when another action finish

    Hi all,
    first, sorry for my bad English....
    I am an Italian Architect, I use Photoshop actions mostly to manage many big tiff files.
    I try to solve this problem since long time.... but so far I can't..  :-(
    This is my problem: I woul'd like to use some actions in sequence launcing only the first one, and when the first finish the second starts automatically, when the second finish, the third starts automatically, and so on.
    Example
    I have 3 actions and a folder "X" that contain tiff files:
    I launch action "A" that resize, colorize, etc tiffs files in folder "X" and put them in a folder "Y"
    only WHEN action "A" finish........
    action "B" starts and works in folder "Y", grouping logically tiff files in some layerized PSD files and putting them in folder "Z"
    only WHEN action "B" finish........
    action "C" starts and works on PSD files in folder "Z" doing some "save as" at different resolution in some folders (folder "JPG", folder "PDF", etc)
    I hope to explain clearly my problem.
    Thanks a lot
    Emanuela

    Hi Mylenium,
    I will try to call existing actions creating a new one (?), but I tell you that I don't understand your question "Does that not give the same result, just only per individual file?"
    thanks
    Emanuela

  • Have Web App/Transaction monitoring alert only when majority of watcher nodes are in error?

    We do a lot of web app/transaction monitoring and we have watcher nodes distributed globally. When we have connectivity issues at a site hosting a watcher node, the web monitors that target the watcher node in that site all alert even though all the other
    watcher nodes are fine.
    We'd like to reduce the noise from our web monitoring by having alerts fire only when a majority, or some other defined ratio, of watcher nodes are in an error condition. Is this possible, and if so, how?
    For reference, we're running 2012 R2 and monitor hundreds of URLs. This list of URLs and watcher nodes is fairly dynamic, so we'd prefer to find a solution that doesn't require manual development (e.g. creating distributed apps), however if that's the only
    path then it would also be good to know.

    First, disable the alerts from the web application that you have created.
    Next, create a new distributed application.  Use the 'Blank (Advanced)' template.  When it comes to choosing the management pack, set it to be the same as the one used for the web monitor.
    Once the distributed application designer has loaded, client the 'Add Component' button.
    Give it a name - Something like 'Appname web monitor component group'
    Choose the 'objects of the following type(s)' radio button.  Navigate the tree:
    Entity -> Logical Entity -> Perspective -> Web Application Perspective -> YOURWEBMONITOR
    Tick the box next to the name of your web monitor.
    Now, on the left, in the Objects bar, you should see the watcher nodes for your web application.  Add ALL the watcher nodes into the component group by dragging them in.
    Now save your distributed application.
    Click the title of the component group that you have just created, down the bottom right of the window there will be a link called 'Configure Health Rollup'.  Click that.
    In the override properties window, Tick the box next to the 'Rollup Algorithm' and change the Override Value to Worst state of a percentage of members in good health state' and override 'percentage' value into your expected value.
    OK the changes and then save the distributed application once again.
    Before you exit the designer, note the name of the component group that you created.
    Finally, we have to enable alerting for that component group.  To do this, exit the designer and you should be back in the Authoring pane of the console.
    Go to "Management Pack Objects\Monitors" in the console.  Click on the Scope toolbar button to  scope the view -
    if a scope was previously active, this will disable the scoped view, so click the button again.  You should be presented with a "Scope Management Pack Objects Window"
    Click the "Clear All" button at the bottom of that window, then type in the
    name of the component group that you noted down earlier into the search box.  A single line should be displayed in the search results.  Tick the box and click OK.
    There should now be a yellow bar saying that the view has been scoped to your web application component group.  Underneath will be a tree view of the monitors in your web applicaion.
    Expand the tree view until you find a monitor called "Component Group Health Roll-up for type..."
    Open the properties of that item, go to the alerting tab and
    enable the "generate alerts for this monitor" checkbox.
    You can then fill in the alert name and description as well as other things like severity and whether or not the alert will close when the monitor is healthy.
    Roger

  • Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?

    Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?
    A little background info. I use Captivate 7 and currently have over 100 projects that I maintain on a quarterly basis. I publish using the SWF format and upload the swf/htm files to a server where they are then accessed from a few locations (within our online documentation, in our software product, on two different websites). Many of the projects are linked so some will be viewed as a series and others viewed as a standalone video. Each video uses the same template and includes an intro and end slide. Now my organization wants to implement a new intro to all videos (those I publish and those from several groups across the organization). My current intros provide overview material for the specific video so the new intro, which is an animation with audio in mp4 format, would need to be placed at the start of each project. The issue is, the intro adds 9 seconds to every video and in many cases doesn’t add any value (say, if a user accesses the video from within our product or views the videos as a series). I’ve talked it over with my boss and we want to try to add the intro only to videos accessed from site X, not any other location. So now to my question. Is there a way to play an external mp4 file (intro) only when the published project is accessed from a specific site, therefore eliminating the need to update each project? Maybe there's a way to add a parameter or variable to the URL or the html code?
    Thanks in advance for your suggestions. Please let me know if you need additional information.

    AimeeLove,
    I have a solution for you.  You may have to modify the code a little bit based on how long the timeline animation is for your clock.  I based mine on 3 seconds to complete a minute hand sweep around the clock.
    Milliseconds for each point on the clock:
    12 = 0
    1 = 250
    2 = 500
    3 = 750
    4 = 1000
    5 = 1250
    6 = 1500
    7 = 1750
    8 = 2000
    9 = 2250
    10 = 2500
    11 = 2750
    In the mouseover section for 12 o' clock, put this code...
    myVar = setInterval(function(){
         var pos = sym.getPosition();
         if (pos > 0 && pos < 50){
              sym.stop(0);
              clearInterval(myVar);
    },10);
    When you point to the time, the setInterval method loops every 100th of a second and checks the current position of the timeline.  When the timeline reaches the range between 0 and 50 milliseconds (almost impossible to hit 1 specific point), the timeline will stop at 0.  Also, the clearInterval will be fired to stop the loop.
    In the mouseout section, put this...
    sym.play();
    clearInterval(myVar);
    It start the clock again, and it also clears the loop in case you mouseout before you reach the range.
    Make sure that myVar is a global variable so you can clear it from the mouseout section.
    Repeat this for each point on the clock.  To avoid potential conflicts, you may want to use my12, my1, my2, etc. instead of myVar.  I put the milliseconds at the top that you would use as the beginning of the range.  50 milliseconds should be enough to catch it.  So, for 5 o' clock, you would make your range between 1250 and 1300.
    Let me know if you have any questions.  Thanks!
    Fred

  • Yours sincerely! I just bought a Sony DCR-SD1000 camera only when installing the cd drivers not supported by the operating system Machintosh. I've contacted the seller said the store did not provide for the apple os. How can I move all the files on the ca

    Yours sincerely! I just bought a Sony DCR-SD1000 camera only when installing the cd drivers not supported by the operating system Machintosh. I've contacted the seller said the store did not provide for the apple os. How can I move all the files on the camera the port out is to use a USB data cable to a laptop for my macbookpro can not read the contents of the file and the camera. I also want to use the lens on the camera as a substitute for the embedded camera on my macbookpro, what should I do to replace the embedded camera on macbookpro with sony camera so that the camera could be more variety and can I record when I turned macbookpro . Please help for this so that I can quickly capture the results from sony camera to my macbookpro. Thank you.

    See this page http://macosx.com/forums/networking-compatibility/296947-sony-camcorder-my-mac.h tml - might be some helpful tips there.
    Clinton

  • I duplicated a picture and now iPhoto (11) is cloning that picture replacing all the other photos and only when I click directly on them I can see the real picture! How can I solve the problem without losing any saved picture? Shall I re-install? Thanx

    I duplicated a picture selecting CMD and D but, suddenly, iPhoto (latest version '11) started cloning that picture and replacing all the other photos with it.
    Only when I click directly on one photo I can open it and see the real picture it is.
    But the preview is always the duplicated one...
    I tryed to duplicate another picture just to see if it turned out ok but the only changement was the duplicated picture!
    I started repeating the second duplicated one instead of the previous one but my issue remained the same.
    So, how can you help me to solve this problem without losing any saved picture?
    Shall I re-install iPhoto completely?
    Thank you very very much in advance!!

    As Larry says, restoring the back up is the fastest and best solution. Otherwise:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • How do I make a textured image appear only when the button is selected?

    I am trying to create a DVD menu that has a textured image (bulletholes) appear only when a button highlighted (ie, about to be selected).
    The only think I can work out is how to make the button appear as a sub-picture that has a solid colour appear on top of it when selected.
    In summary, here is what i am trying to achieve:
    1- there are 5 DVD menu items
    2 - the user can select any of those items
    3- as they move between each item, I want a I want a multi-coloured (textured) image to appear.
    I can not work this out.
    Any advice greatly appreciated.
    Richard.

    Thanks for this.  This is most surprising to hear!
    I have been using DVD Studio Pro for years and we have been able to do add textured or multicoloured buttons.
    Am I correct in understanding that in Encore, if a menu has 6 options, I need to create 6 different menus and import them all and use the auto activate state to make this work?
    Is there a workaround for making this work on a computer?

  • Sender file communication channel polling only when the file is written

    Hi guys,
    I have the following scenario:
    I have developed an XI interface that takes a .txt file from SAP R/3's file system, usr/sap/trans/ and delivers it into another ftp location. The problem that we face is that the file is written into source directory from an ABAP program. As a result, XI go and polls into source directory when the file is not completely written, or when it is empty, which blocks the process.
    Is there a way to force XI in order to poll the source directory only when the file is complete?
    We have thought of exporting the file into a name that XI does not expect and as soon as the file is complete to rename the file from inside ABAP program into what XI expects.
    However, the command inside ABAP changed the Code page of the file and we cannot see some special characters in the file that is delivered to the ftp location.
    Any ideas??

    Hi Evaggelos,
    from <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm">SAP help: Configuring the Sender File/FTP Adapter</a>:
    Advanced Mode
    To specify additional parameters in the adapter configuration, set the Advanced Mode indicator.
    &#9679;      Msecs to Wait Before Modification Check
    Enter the number of milliseconds that the adapter must wait before it checks whether the files have been changed
    Regards,
    Udo

  • How to program shift register to read only when a new user is detected from user?

    Hi,
    I'm currently developing a program for position control in labview. The program is quite simple, whereby user will input the distance that he wants the table to be in the labview program, and labview will send signal to move a motor that will turn a ball screw to move a table horizontally to the targetted position. The criteria is that the profile of the motor depends on the distance it needs to move, whether a two-phase (acceleration and deceleration) or three-phase (acceleration, constant velocity, deceleration) to reach the target position.
    The problem occurs when the user wants to enter a new position (second input) for the table, as the input by user is position the table needs to be but the input required to determine which profile the motor follows depends on the distance that the table will move to get to the targetted position. Therefore, I would need a function to store the input by user temporarily, and recall it only when a new input from user is detected. By this, I would be able to use the difference of the input (input [n+1] - input[n]) and feed it to determine which profile the motor follows and the input by user can be kept as the position he wants the table to travel to (to compare with encoder).
    I thought of using shift registers to do this, but I am not able to make it to perform the deduction ([n+1] - [n]) only when it detects a new input. When i try using shift register, it travels to the targetted position, and one it reaches it will travel back to the original position. For example, when a user input 90, it means the table needs to move to point 90. As the shift register is initialized to 0, it will move to point 90 (90-0 = 90) but upon reaching 90, the shift register sends a signal of 90 (90-90 = 0) and the table returns to it's initial position.
    Is there any way that I can delay the reading of shift register only when a new input is detected or is there another way for me to achieve what i want?
    I've tried searching the discussion forum and ni website but couldn't find similar problems. Thanks for your help in advance.
    Solved!
    Go to Solution.

    Hi,
    I've managed to get what I needed by using a shift register + event structure as suggested by Adnan. However, I face another problem after implementing SR+event. I've attached two files, first the original program and second the updated program using SR + event. (it's only the jpg file as I've forgotten to save the labview program, will upload the program by tomorrow.
    In the original program, I have an elapsed time that is able to run continuously when I run the program. In the updated program, my elapsed time don't seem to run continuously when I run the program (as shown by elapsed time indicator). I need the elapsed time to run continuously as a input to calculate my motor profile.
    I suppose this is caused by the introduction of the event structure, will adding a case structure to wrap the event structure solve the problem or is there another way to get pass this. Appreciate if someone could drop me a pointer or two.
    Thanks
    Attachments:
    Mar 16 - continuous elapsed time.png ‏12 KB
    Mar 16 - elapsed time not continuous after introducing shift register + event structure.png ‏17 KB

Maybe you are looking for

  • Help needed for IPC configuration error

    hi all, I have installed IPC according to installation guide, RFC's are working perfectly. IPC_COM_SESSION_BEGIN gives a value. Still i get the following error while checking  the ipc monitor n runnin the test. Testing IPC standard installation. This

  • Diskutility failing to repair permissions

    I have a persistent problem with permissions. whenever i run disk utility, it finishes with a 'permissions repair complete' message but if i re-run it the same list of permissions error shows up again. Below is the list of errors which i get: Permiss

  • How to download chinese language to nokia 113?

    Any way to download Chinese language to Nokia 113? Solved! Go to Solution.

  • Video Audio Mute Problem

    I'm having a problem with the audio from the Quicktime movies I've imported for the film I'm scoring. I extract the audio from the movie, place it in an audio track and then mute the original audio using "Song Settings>Video>Sound Output>Mute. This w

  • TS3694 i have a problem to restore a software of ios6 to my iphone 2G

    i have a problem to restore a software of ios5 to my iphone 2G when during restoring the software its says firewere error how can i fix that