How to get results for different conditions of a line?

Hello

I have the following statement for 11g

Select sum (A.Wert) of
(
with t as (select vtobslpos. RANK rank #, vtobslpos. ANZAHL count #, vtobsl.faellig f #, vtobslpos. PAYMENT vtobslpos wert, vtobsl
where vtobslpos. SYSVTOBSL = vtobsl.sysid and vtobsl.inaktiv = 0 and vtobsl.sysvt = 165406
)
t1 as)
Select rownum rn
of the double
connect by level < = (select sum (County #) t)
)
Select row_number() line (order of ranking #, rn) #, ranking #, 1 count, add_months (f #, row_number () (order of ranking #, rn)-1) Faellig, Wert
t, t1
where t1.rn < = t.count #.
) AT
' where A.Faellig > = ' 30.06.2011.
' - where A.Faellig between ' 30.06.2011 "and + 30 to_date('30.06.2011','dd.mm.yyyy')
-where A.Faellig between to_date('30.06.2011','dd.mm.yyyy') and to_date('30.06.2011','dd.mm.yyyy') + 30, 90

that works fine for all three, where the conditions used both. What I would like to have are the different results of the sum (A.Wert) of all three conditions

"Condition 1: where A.Faellig > = ' 30.06.2011.
"Condition 2: where A.Faellig between ' 30.06.2011" and + 30 to_date('30.06.2011','dd.mm.yyyy')
Condition 3: where A.Faellig between to_date('30.06.2011','dd.mm.yyyy') and to_date('30.06.2011','dd.mm.yyyy') + 30, 90

in a row without repeating the statement internal / virtual table (with t as...-...) One that provides a payment stream that is stored in a form that is compressed in the comic book as follows

LINE # FAELLIG WERT
1 15.10.2004 00:00:00 691,48
15.11.2004 2 00:00:00 691,48
15.12.2004 3 00:00:00 691,48
4 15.01.2005 00:00:00 691,48
15.02.2005 5 00:00:00 691,48
15.03.2005 6 00:00:00 691,48
15.04.2005 7 00:00:00 691,48
15.05.2005 8 00:00:00 691,48
15.06.2005 9 00:00:00 691,48
15.07.2005 10 00:00:00 691,48
15.08.2005 11 00:00:00 691,48
15.09.2005 12 00:00:00 691,48
15.10.2005 13 00:00:00 691,48
15.11.2005 14 00:00:00 691,48
15.12.2005 15 00:00:00 691,48
15.01.2006 16 00:00:00 691,48
15.02.2006 17 00:00:00 691,48
15.03.2006 18 00:00:00 691,48
15.04.2006 19 00:00:00 691,48
15.05.2006 20 00:00:00 691,48
15.06.2006 21 00:00:00 691,48
15.07.2006 22 00:00:00 691,48
15.08.2006 23 00:00:00 691,48
15.09.2006 24 00:00:00 691,48
15.10.2006 25 00:00:00 691,48
15.11.2006 26 00:00:00 691,48
15.12.2006 27 00:00:00 691,48
15.01.2007 28 00:00:00 691,48
15.02.2007 29 00:00:00 691,48
15.03.2007 30 00:00:00 691,48
15.04.2007 31 00:00:00 691,48
32 15.05.2007 00:00:00 691,48
33 15.06.2007 00:00:00 691,48
34 15.07.2007 00:00:00 691,48
35 15.08.2007 00:00:00 691,48
36 15.09.2007 00:00:00 691,48
37 15.10.2007 00:00:00 691,48
38 15.11.2007 00:00:00 691,48
39 15.12.2007 00:00:00 691,48
40 15.01.2008 00:00:00 691,48
41 15.02.2008 00:00:00 691,48
42 15.03.2008 00:00:00 691,48
43 15.04.2008 00:00:00 691,48
44 15.05.2008 00:00:00 691,48
45 15.06.2008 00:00:00 691,48
46 15.07.2008 00:00:00 691,48
47 15.08.2008 00:00:00 691,48
48 15.09.2008 00:00:00 691,48
49 15.10.2008 00:00:00 691,48
50 15.11.2008 00:00:00 691,48
51 15.12.2008 00:00:00 691,48
52 15.01.2009 00:00:00 691,48
53 15.02.2009 00:00:00 691,48
54 15.03.2009 00:00:00 691,48
55 15.04.2009 00:00:00 691,48
56 15.05.2009 00:00:00 691,48
57 15.06.2009 00:00:00 691,48
58 15.07.2009 00:00:00 691,48
59 15.08.2009 00:00:00 691,48
60 15.09.2009 00:00:00 691,48
61 15.10.2009 00:00:00 20000
62 15.11.2009 00:00:00 1500
63 15.12.2009 00:00:00 1500
64 15.01.2010 00:00:00 1500
65 15.02.2010 00:00:00 1500
66 15.03.2010 00:00:00 1500
67 15.04.2010 00:00:00 1500
68 15.05.2010 00:00:00 1500
69 15.06.2010 00:00:00 1500
15.07.2010 70 00:00:00 1500
71 15.08.2010 00:00:00 1500
72 15.09.2010 00:00:00 1500
73 15.10.2010 00:00:00 1500
74 15.11.2010 00:00:00 1500
75 15.12.2010 00:00:00 1500
76 15.01.2011 00:00:00 1500
00:00:00 77 15.02.2011 1500
78 15.03.2011 00:00:00 1500
79 15.04.2011 00:00:00 1500
80 15.05.2011 00:00:00 1500
81 15.06.2011 00:00:00 1500
82 15.07.2011 00:00:00 1500
83 15.08.2011 00:00:00 1500
84 15.09.2011 00:00:00 1500
85 15.10.2011 00:00:00 1500
86 15.11.2011 00:00:00 1500
87 15.12.2011 00:00:00 1500
00:00:00 88 15.01.2012 1500
00:00:00 89 15.02.2012 1500
00:00:00 90 15.03.2012 1500
00:00:00 91 15.04.2012 1500
00:00:00 92 15.05.2012 1500
93 15.06.2012 00:00:00 1500
00:00:00 94 15.07.2012 1500
95 15.08.2012 00:00:00 1500
00:00:00 96 15.09.2012 1500
97 15.10.2012 00:00:00 1500
98 15.11.2012 00:00:00 1500
99 15.12.2012 00:00:00 1500
100 15.01.2013 00:00:00 1500
101 15.02.2013 00:00:00 1500
102 15.03.2013 00:00:00 1500
00:00:00 103 15.04.2013 1500
104 15.05.2013 00:00:00 1500
105 15.06.2013 00:00:00 1500
106 15.07.2013 00:00:00 1500
107 15.08.2013 00:00:00 1500
108 15.09.2013 00:00:00 1500
109 15.10.2013 00:00:00 1500
00:00:00 110 15.11.2013 1500
111 15.12.2013 00:00:00 1500
112 15.01.2014 00:00:00 1500
113 15.02.2014 00:00:00 1500
114 15.03.2014 00:00:00 1500
115 15.04.2014 00:00:00 1500
116 15.05.2014 00:00:00 1500
117 15.06.2014 00:00:00 1500
118 15.07.2014 00:00:00 1500
119 15.08.2014 00:00:00 1500
120 15.09.2014 00:00:00 1500
121 15.10.2014 00:00:00 1500
122 15.11.2014 00:00:00 64883,93

Thanks a lot for any help
Best regards
Carsten

Something like that...

SELECT
SUM( CASE WHEN condition1 THEN A.Wert ELSE 0 END ) AS sum1,
SUM( CASE WHEN condition2 THEN A.Wert ELSE 0 END ) AS sum2,
SUM( CASE WHEN condition3 THEN A.Wert ELSE 0 END ) AS sum3
FROM
(
with t as
..
..
..
-- Remove the three conditions from the WHERE clause

-Rakesh

Tags: Database

Similar Questions

  • How to get LASTDAY for each month between data dates...

    Hi friend

    I have a doubt, how to get LASTDAY for each month between data dates...

    for ex:
    My contribution will be like this
    date = 01/12/2011
    To date = 14/04/2011

    And I need an output like
    31/01/2011
    28/02/2011
    31/03/2011

    is it possible to achieve through sql query in oracle
    Thanks in advance for all friends to help him

    Hello

    Something like this (assuming that the dates are originally VARCHAR2s):

    SQL> var dt_start varchar2(10)
    SQL> var dt_end varchar2(10)
    SQL> exec :dt_start := '12-01-2011'
    
    PL/SQL procedure successfully completed
    
    SQL> exec :dt_end := '14-04-2011'
    
    PL/SQL procedure successfully completed
    
    SQL>
    SQL> select last_day(
      2           add_months(
      3             trunc(to_date(:dt_start,'DD-MM-YYYY'),'MM'),
      4             level-1
      5           )
      6         ) as result
      7  from dual
      8  connect by level <= months_between(to_date(:dt_end,'DD-MM-YYYY'), to_date(:dt_start,'DD-MM-YYYY'))
      9  ;
    
    RESULT
    -----------
    31/01/2011
    28/02/2011
    31/03/2011
     
    

    If the dates are already of the date data type, simply remove the to_date function.

  • How to get drivers for my smart tv S320/PB74300101

    How to get drivers for my smart tv S320/PB74300101

    I would start by going to a site of Packard Bell. They made your TV and they argue, not HP.

    This is the forum of global consumer of Hewlett Packard (HP).

    Best regards
    ERICO

  • How to get licenses for charity in India (Vipassana International Academy)

    I want Licenses to charity for A worldwide non-profit organization. Our main office is located in India (Vipassana International Academy)

    Please suggest who to contact and how to apply, I tried the link of
    But it displays error for the Indian region.
    Please suggest how to get licenses for charity in India

    See the following topics:

    http://www.Microsoft.com/licensing/

    There is a section for charity.

  • I canceled my account same day and join as convert PDF word has not converted correctly how to get credit for membership cancellation

    I canceled my account same day and join as convert PDF word has not converted correctly how to get credit for membership cancellation

    You need to contact Adobe customer service:

    They will check and help you. (Live chat)

    Contact the customer service

  • How to get alerts for hardware failures

    Hai,

    As I am new on the vmware I'm interested to know how many VI troubleshooting if something goes wrong?

    How to get alerts for hardware failures? IF a drive failed in RAID1 how to identify? VM is grayed out, no use via the GUI and Console, where to check?

    If anyone knows where to find the answers for part of vsphere troubleshooting please let me know, is there any blogs or sites for beginners? Am in the theritical part. I need troubleshooting documents or videos.

    Thanks in advance

    In vSphere, you can monitor hardware heakth and status and receive alerts in the client vSphere also depending on the hardware that you use you can take for that hardware manufacturers probes.

    For troubleshooting / you can check this site - http://www.vmware.com/support/product-support/vsphere/

  • How to get credit for a movie that I rented on ITunes via my Apple TV

    Yesterday, I rented a movie on ITunes via my Apple TV. When I started to watch the movie and it turned out to be cut the Director (so every scene had an announcer describing the action). However who stated not anywhere on the news of the film until I chose to rent it out. I think that someone downloaded the wrong version of the film erroneously. The movement was 'joy '.

    Anyway, how can I go to get credit for my movie rentals?

    With the receipt of electronic mail, use the report a problem link.

  • How to get replacement for Windows software

    original title: get a CD of Windows Vista Home Premium x 32 to reinstall the software on my PC corrupted who does not run correctly.

    I need to know how to get a replacement of Windows Vista Edition Home Premium x 32 CD so I can reinstall Windows on my corrupted PC that is not running properly. I heard that you can get one with an approximate cost of $10,00. Thanks for your time

    I need to know how to get a replacement of Windows Vista Edition Home Premium x 32 CD so I can reinstall Windows on my corrupted PC that is not running properly. I heard that you can get one with an approximate cost of $10,00. Thanks for your time

    Hey firehawk9591

    read the information on the microsoft below link

    How to replace Microsoft software or hardware, order service packs and replace product manuals

    http://support.Microsoft.com/kb/326246

    If vista came preinstalled contact, the direct computer manufacturer and ask them to send you recovery disks vista to reinstall operating system back tp the way it was when you bought it

    they do it for a nominal cost of $

    Walter, the time zone traveller

  • I won a mini iPad 4 generation how to get applecare for my iPad

    Hi I have a question I win an iPad mini 4 generation is possible to get Applecare for my mini iPad 4 given that I have not received.

    Thank you for your support

    Rolly

    Hello, Rolly!

    No, unfortunately, you will need to have bought the iPad in the last 60 days to add AppleCare, and I do not win it counts as purchase.

    Here's more information.

    http://www.Apple.com/support/products/iPad.html

  • How to get data for submission of form using REST or SOAP API

    Hello

    Can someone let me know how to recover data using REST or SOAP API for example, also I need to know how to delete some data from form submission using REST or SOAP API for submission of form. Answer please I need to implement in one of my projects.

    Thanks and greetings

    Angela

    Post edited by: Md Shahid

    Here the answer How to recover data for submission of form using REST or SOAP API

  • Same result for different frequencies?

    Hi all

    I'm new to labview and the communication kit, so I'm trying to test the examples.

    When the example of 'Rx Continuous Sync or Async' opening and it works I get the same output on the "power spectrum".
    i'm checking different frequencies in the range of 1.2 GHz to 6 GHz.

    How is it possible then that there is nothing transmitted? -> checking with the android application for wifi channels (channels 1 to 8 are used, all others are not...) and yet labview gives me the same result... (attached file = 2 GHz, the other is a comparison of the 5 GHz, 2,412 GHz and 2,484 GHz)

    material:

    NEITHER USRP N210 (rev 4)
    CBX 1200-6000 MHz Rx/Tx (40 MHz)
    Antenna VERT900

    connecting via gigabit

    PC: W7 64 bit, i7-2600 to 3.4 GHz, 4 GB RAM

    Thanks in advance

    Hey insiderbe,

    I did some research on the Ettus forum and found the following:
    https://lists.gnu.org/archive/HTML/discuss-gnuradio/2010-08/msg00237.html
    https://www.Ruby-Forum.com/topic/214890

    I suspect that the IPS you see on 0Hz is the DC offset that is introduced to the ADC of the USRP N210. We can confirm this by removing air and closing the RX. If the tip is still there, it's a feature of the analog input circuit.

    Brian of Ettus recommends tuning your frequency slightly out of your signal of interest and using a high pass filter to remove DC offset. I recommend looking at the second link for more information.

    With respect to obtaining the value of art through many different frequencies, I think that it is a property of the antenna used. The VERT900 is valid from 824-960 MHz and 1710-1990 MHz. can you listen to one of these groups and test your power, even if you have a known signal? You have another USRP generator or a function to generate a known signal?

    https://www.ettus.com/product/details/VERT900

    My last concern use the N210 with the CBX in LabVIEW Communications. According to the Readme, it's an unsupported hardware configuration, which means that R & D has not tested the configuration, and we do not know how the configuration will occur.

    http://download.NI.com/support/softlib//RF/NI%20USRP/15.0/niUSRP_readme.html

    Thank you for this post!

    Kind regards

  • List of deployed applications. Different results for different hierarchies of MBean

    Hello

    When I list deployed applications, I get different results depending on what hierarchy MBean I question:

    • serverConfig():
    wls:/MY_WEBLOGIC_DOMAIN/serverConfig> listApplications() APPLICATION_1APPLICATION_2
    

    • domainRuntime():
    wls:/MY_WEBLOGIC_DOMAIN/domainRuntime/AppRuntimeStateRuntime/AppRuntimeStateRuntime> ls()
    -r--   ApplicationIds                               java.lang.String[APPLICATION_1, APPLICATION_2, APPLICATION_3]
    

    No idea why is APPLICATION_3 in the list?


    Thanks in advance,

    Luis


    PS: if I apply directly to the managed server:

    wls:/MY_WEBLOGIC_DOMAIN/domainRuntime/ServerRuntimes/prodGAD_1> ls('ApplicationRuntimes')
    dr--   bea_wls9_async_response
    dr--   bea_wls_cluster_internal
    dr--   bea_wls_deployment_internal
    dr--   bea_wls_diagnostics
    dr--   bea_wls_internal
    dr--   APPLICATION_1
    dr--   APPLICATION_2
    

    Hi Vijaya,

    Thanks for your reply, yes you are right, my config.xml file I see this request:

      
        APPLICATION_3
        ...
        ear
        ...ear
        DDOnly
      
    

    But now that I read your response, I already rebooted the AdminServer. This new beginning has resolved the problem.

    Thank you

    Luis

  • How to get updates for Firefox on my laptop.

    I get that my Firefox is still to date, but cannot find the place where or what is the most updated version of it and
    How do I know that it updates automatically.

    Scribe_uk said

    Hi, you can check for updates and your version by going to-main menu > help (question mark at the bottom) > on Firefox.

    Wow, I didn't know that you can access from here! Thank you! + 1

  • Satellite Pro A100: How to get updates for driver for ATI Radeon Mobility X 1400

    Hello

    I am aware that the driver for my on-board graphics card is outdated.
    When I download a updated from ATI driver and try to install, it tells me that I can't install the update the system there and contact Toshiba for the updates.

    Please can someone tell how can I get a driver updates for this card on my Satellite Pro A100 series?

    Concerning

    Macca.

    Hello

    You can not install drivers ATI ATI site because these drivers are not designed and certified for Toshiba laptops.
    These drivers can affect the functionality of notebooks and in worst cases could overheat your GPU

    * So if you want to use these drivers, you can do it but only at your own risk! *

    You can install this driver in Device Manager;
    You must use the Advanced installation procedure and you will have to indicate where the graphic driver files were stored on the HARD drive

    Good bye

  • How to get driver for hp photosmart 7660 on windows 8

    How/where can I get a driver to work on my p7 hp with victory 8 for my hp photosmart 7660 color printer?

    Thank you, rgask

    I want to qualify these measures by saying that I've seen this work with the versions Windows Server that does not support printers. This is not guaranteed, but it should. If it isn't, then it is not a way to get this printer to install with Windows 8.

    To install a printer that isn't a driver for Windows 8 in Windows 8:
    1. connect the device to the computer.
    2. Windows will try to find a driver but will not be able to.
    3. close the notifications popping up.
    4. hold your mouse in the upper or lower part right corner of the computer screen to show the charms. If you have a touch screen, you can drag your finger left from the right edge of the screen.
    5. click on search.
    6. in the search box, click settings.
    7. in the search box, type Device Manager.
    8. Select Device Manager in the list on the left.
    9. click on view, then select hidden.
    10. you should see a device in the list with a yellow triangle with an exclamation mark inside.
    11. right click on the device and select install/update driver.
    12. a window will come with 2 choices. Choose "Browse my computer for driver software".
    13. in the next window, select "Let Me pick from a list of drivers for devices on my computer.
    14. in the next window, make sure that the checkbox next to "Show compatible hardware" is not selected.
    15. in the manufacturers list, select HP.
    16. in the model list, select the class of PCL3 Deskjet driver, the Deskjet 990c printer driver or the driver for Deskjet 450.
    17 click Next.
    18. click on finish.
    19. try to print.

Maybe you are looking for

  • Download Powerpoint on YouTube

    How to download a PowerPoint about YouTube?  I need to convert it to a different type of file and if so, how?  Should I get a codec?  What IS a codec, anyway?

  • How can I get rid of the bar search "suggestions"?

    I'm not the slightest bit interested in 'Free engine research tool' IE8 right... and I can't figure out how to remove/disable it. Can someone tell me how?

  • Does not update VISTA Windows Live Update Code 80240016

    My son computer caught a virus. By running programs to repair, I discovered that its Live Update failed since 24/04/2009. That has worked successfully for 17/11/2007 until 04/24/2009. Nothing has been updated during this period. Windows Defender defi

  • BlackBerry Smartphones what Micro SD Version works with the 9310

    I recently bought a new 64gd micro sd card for my 9310 and whenever I put it, it says: "the version of media card that you inserted is not supported. What does that mean? This means that I have to get a new micro sd card or the 9310 cannot hold a 64

  • Display time of blackBerry Smartphones

    My "BOLD" is often an hour behind the real time, regardless of if I put 'Network', 'Blackberry' or 'Off' for updates.  I found that I "update" almost constantly the time - and the 'network' (below the "" time is always correct.)  I have the correct t