How would i go about this query

I need to sum 3 of the same volume fields based on 3 diff where in clauses. in one single query. So basicaly these three queries below in one query. Its been a long time since ive had to do queries, can any also link me to a good resource for understanding nested selects, unions etc..
SELECT A.DAYTIME,
SUM(A.GRS_VOL_GAS_SE3M3) AS SWEET_FUEL_CONS
FROM
RV_STRM_DAY_STREAM_MEAS_GAS A
WHERE
A.CODE IN ('M_2370', 'M_8251','M_GYCOL')
AND A.DAYTIME >= TO_DATE('01-Jan-2006')
AND A.DAYTIME <= TO_DATE('31-Jan-2006')
GROUP BY A.DAYTIME
ORDER BY A.DAYTIME
SELECT A.DAYTIME,
SUM(A.GRS_VOL_GAS_SE3M3) AS SOUR_FUEL_CONS
FROM
RV_STRM_DAY_STREAM_MEAS_GAS A
WHERE
A.CODE IN ('M_1370A', M_1370B','M_1370C','M_1370D', M_1370E','M_1370F')
AND A.DAYTIME >= TO_DATE('01-Jan-2006')
AND A.DAYTIME <= TO_DATE('31-Jan-2006')
GROUP BY A.DAYTIME
ORDER BY A.DAYTIME
SELECT A.DAYTIME,
SUM(A.GRS_VOL_GAS_SE3M3) AS Flare
FROM
RV_STRM_DAY_STREAM_MEAS_GAS A
WHERE
A.CODE IN ('M_8300')
AND A.DAYTIME >= TO_DATE('01-Jan-2006')
AND A.DAYTIME <= TO_DATE('31-Jan-2006')
GROUP BY A.DAYTIME
ORDER BY A.DAYTIME

not sure if this is what you are looking for:
Select a1.daytime,
       sum(a1.sweet_fuel_cons) sweet_fuel_cons,
       sum(a1.sour_fuel_cons)  sour_fuel_cons,
       sum(a1.flare)           flare
  From (SELECT A.DAYTIME,
               SUM(A.GRS_VOL_GAS_SE3M3) AS SWEET_FUEL_CONS,
               0 SOUR_FUEL_CONS,
               0 Flare
          FROM RV_STRM_DAY_STREAM_MEAS_GAS A
         WHERE A.CODE IN ('M_2370', 'M_8251','M_GYCOL')
           AND A.DAYTIME >= TO_DATE('01-Jan-2006','dd-mon-yyyy')
           AND A.DAYTIME <= TO_DATE('31-Jan-2006','dd-mon-yyyy')
        GROUP BY A.DAYTIME
        UNION
        SELECT A.DAYTIME,
               0 SWEET_FUEL_CONS,
               SUM(A.GRS_VOL_GAS_SE3M3) AS SOUR_FUEL_CONS,
               0 Flare
          FROM RV_STRM_DAY_STREAM_MEAS_GAS A
         WHERE A.CODE IN ('M_1370A', M_1370B','M_1370C','M_1370D', M_1370E','M_1370F')
           AND A.DAYTIME >= TO_DATE('01-Jan-2006','dd-mon-yyyy')
           AND A.DAYTIME <= TO_DATE('31-Jan-2006','dd-mon-yyyy')
        GROUP BY A.DAYTIME
        UNION
        SELECT A.DAYTIME,
               0 SWEET_FUEL_CONS,
               0 SOUR_FUEL_CONS,
               SUM(A.GRS_VOL_GAS_SE3M3) AS Flare
          FROM RV_STRM_DAY_STREAM_MEAS_GAS A
         WHERE A.CODE IN ('M_8300')
           AND A.DAYTIME >= TO_DATE('01-Jan-2006','dd-mon-yyyy')
           AND A.DAYTIME <= TO_DATE('31-Jan-2006','dd-mon-yyyy')
        GROUP BY A.DAYTIME) a1
Group by a1.daytime;

Similar Messages

  • Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Since your Mac probably came with 10.4, there is no longer a way to get 10.5 Leopard install media. IF it has the requirements, you may be able to upgrade to 10.6 Snow Leopard by buying the boxed install media at the Apple Store for $30.
    System requirements are found here: http://support.apple.com/kb/SP575
    General support can be found here: http://www.apple.com/support/snowleopard/

  • I recently Brooke the screen on my iPhone 5. I need to cases my data and would like to remotely set up iCloud on my broken 5 using my iPad. How would I go about this?

    I recently Brooke the screen on my iPhone 5. I need to cases my data and would like to remotely set up iCloud on my broken 5 using my iPad. How would I go about this?

    Took my phone to the Apple store this week and they told me it was a hardware/screen malfunction. They replaced the screen for free since it was under warranty. Now it works fine again!

  • I have CS3 for Windows but want to switch to Mac, how would I go about this?

    I have CS3 Design Premium for Windows on an old laptop but want to switch it to my new Mac, how would I go about this?
    Do I have to pay for an upgrade to CS6, then somehow switch the license then download to my Mac? Also, I'm a student so it would be a student priced upgrade.

    You can either upgrade or move to Creative Cloud. But since you’re a student an upgrade does not exist so just pick the student version you want and go with that.
    Bob

  • I reside in india but i want to gift a friend in canada an ipod touch how would i go about this, i reside in india but i want to gift a friend in canada an ipod touch how would i go about this

    it says that i cant use a credit card that has a billing address outside canada so how do i got about it. i dont want to have to wire the money to my friend and say go buy yourself an ipod and pretend to be surprised wen it comes home , now can i ?

    - You can buy it in India and ship it yourself to your friend.
    - Wire the money to another friend and have them purchase it and give to your first friend.
    - Or as you say just wire the money directly to your friend.]
    You can only purchase items for a country's Apple store if yo have a payment method associated with that country and the shipping address is that country.

  • HT6058 I have an update to do in my settings app., it wont let me do it on my phone. It is a software update on a iOS 7.0.4 on a iphone 4S. How would I go about this? until its fixed I cant use certian apps., it fixes bugs and viruses and improvements.

    see question above Im having problems updating my iphone 4S updating software that fixes bugs! please contact me at 443-201-6604.

    Are you connected to wifi?
    If you can't do it on the phone, you can most certainly do it via itunes.

  • How would I go about this?

    I have my AE set up in my living room because that's where the cable/modem are hooked up. I'd like to set up another AE station in our home office to do some wireless printing. There's a cable connection in the office but no modem. Is there any way to get my AE working without a modem?

    In theory, it really is that simple, as long as you can get a signal in the second location.
    Extending the network (adding the second AE for WDS) should be straightforward, but getting the printer to work may be a bit trickier. Search these forums to find a printer that's known to work with an AE, Ax or TC. Both of the printers that I own are iffy - the Kodak won't work at all, the Samsung might work, but the Mac driver is a bit flaky.

  • How would I go about getting a text message history for court?

    I need a printed message history of conversations between myself and another party for evidence at a court hearing. How would I go about this as quickly as possible? I can't seem to find an extensive history in my verzion.

    You will need a court order. I suggest you speak with your attorney.
    Keep in mind, the history won't be that extensive. Verizon only has about the last 10 days of history on its servers before they get cleared out to make room for the new ones.
    In the future, you should get an app which backs up your texting history if you feel you need it. SMS Backup & Restore would be a suggestion.

  • I have moved from the UK to Canada and would like to pay for subscriptions in Canadian dollars rather than sterling pounds. Also I would like to take up the offer that I have purchase CS packages in my account. How do I go about this?

    I have moved from the UK to Canada and would like to pay for subscriptions in Canadian dollars rather than sterling pounds. Also I would like to take up Creative Cloud subscription offer because I qualified as a prior purchaser of CS packages.
    How do I go about this?

    I did that - nothing happen... I have changed my adobe ID and all address to my Canada home.
    Having log myself out and re-log back in to start the Creative Cloud subscription. The payment still shows in Sterling Pounds.
    This is difficult as I am no longer earning Sterling pounds as a wage and the subscription would automatically be doubled payment, because Canadian $ is less in currency exchange to the UK Sterling Pound.
    Thanks for your above suggestions, but what should I do now, to resolved this issue.
    Regards
    Robert

  • Good afternoon. I have created a Form in Indesign, imported into FormsCentral. I would like to post this onto a webpage. It is currently an iPDF. How would I go about doing this. I cannot 'Place it'. Thanks

    Good afternoon.
    I have created a Form in Indesign, imported into FormsCentral.
    I would like to post this onto a webpage. It is currently an iPDF.
    How would I go about doing this. I cannot 'Place it'.
    Thanks

    The only way to use Forms Central would be to export it the method that gives you the embed code (can't remember what the actual term is off hand) and then use Object--->Insert HTML and past your code in.

  • Hey, I'm trying to authorize my new laptop with my iTunes account. How would I go about doing this?

    Hey, I'm trying to authorize my new laptop with my iTunes account. How would I go about doing this?

    Hi Michael1296,
    Thanks for visiting Apple Support Communities.
    Here are the steps to authorize a computer in iTunes:
    How do I authorize a computer?
    Open iTunes on the computer you want to authorize.
    Choose Store > Authorize This Computer from the menu bar.
    You might need to show the menu barto see this option in Windows. In earlier versions of iTunes, you can access this option from the Advanced menu.
    Enter your Apple ID and click Authorize.
    If your Apple ID uses an expired MobileMe account, you can still use it to authorize your computer.
    If iTunes asks you to authorize your computer again, it won't use a new authorization. iTunes uses the same authorization for the same computer.
    You can find these steps and more information at this link:
    Authorize your computer using iTunes
    All the best,
    Jeremy

  • I have a short homemade film burnt onto a DVD, I now want to import the movie into IMOVIE on my MacBook Pro so that I can edit it, how would I go about doing this? Welcoming any guidance.  Thanks in advance.

    I have a short homemade film burnt onto a DVD, I now want to import the movie into IMOVIE on my MacBook Pro so that I can edit it, how would I go about doing this? Welcoming any guidance.  Thanks in advance.

    1. Insert your DVD.
    2. Open Disk Utilities (Application> Utilities> Disk Utilities). Highlight your DVD and press "New Image" on the upper toolbar.
    3. Choose the location you would like to save your DVD from the drop down menu, "Desktop" is usually the best choice. Then click Save.
    4. When finished, your DVD icon will appear on the desktop with the .dmg extension.
    5. With iMovie open, double-click the .dmg  file you created to mount it. The iMovie import window will then appear asking you to choose. Click Import All and wait for the Import to complete.

  • I have two (paid) copies of lightroom 5 from your photography promotion installed (on two different machines). I would like to deactivate one copy on one desktop so I can install a copy on my laptop. How do I go about this?

    I have two (paid) copies of lightroom 5 from your photography promotion installed (on two different machines). I would like to deactivate one copy on one desktop so I can install a copy on my laptop. How do I go about this?

    While the standalone version of LR has no deactivation, the Photography Program which is LR + PS-CC bundled and licensed through the Cloud will have a 2-activation limit per Adobe ID, and you cannot decouple the LR from the PS-CC in the Photographers Bundle. 
    You can license the cloud on up to two computers per AdobeID by signing into the cloud.  When you try to sign in on a third computer you have the option to deactivate the other two copies, which you can do, and then never sign into the cloud on the one computer you don’t want activated and you’ll be fine.

  • HT2470 how would i go about taking multiple files from documents and make them part of 1 master file

    how would i go about taking multiple files from documents and make them into 1 master file? I want to put all documents associated with this project together for easier access.

    From the finder window, click File, click new folder, you can drag all documents into that Folder making it the master folder. You can ajso drag folders into the Master folder, and have them as sub-folders if you wish to  do that. Either way they will all be in one master folder.

  • How would you go about limiting file upload

    I don't need source code, just want to know if it's possible or how to go about limiting how many files a user can upload.
    So far
    I can limit what types of files get uploaded.
    I can limit how big those files can be.
    Is it possible, or how would you go about limiting how many files get sent?
    - When the user does a browse they can select multiple files.

    This is the best that I can come up with.
    Ripped from adobe cookbooks
    var fileList:Array = fileReferenceList.fileList;
    if( fileList.length > 4 )
        Alert.show("Too many files" , "Please try again with 4 or less files");
    else
       for (var i:Number=0; i<fileList.length; i++)
           var file:FileReference = FileReference(fileList[i]);
           arrayCollection.addItem({name:file.name, size:file.size, object:file})
    If this post was helpful , please mark it as such.

Maybe you are looking for