How to eliminate the union clause

I have a requirement where I need to get some recording (say 5 records) of the table and the sum (TOTAL) of some columns in these 5 folders that should be displayed as the last record. Im trying it work with union all clause

Select cd
pid
dt
number
type
sum (iamt) iamt
sum (ALMPs) ALMPs
sum (oamt) oamt
idt
from t1
where code = 'NAQ.
Group by cd, pid, dt, idt
Union of all the
Select 'TOTAL '.
null
null
null
null
sum (iamt) iamt
sum (ALMPs) ALMPs
sum (oamt) oamt
null
from t1
where code = 'NAQ;

is there a way I can avoid using the UNION clause and achieve the same...? Kindly share your thoughts...

Hello

Try below:
SELECT cd,
nest,
DT,
NUMBER,
TYPE,
Sum (iAMT) iamt,
Sum (ALMPS) ALMPs,
Sum (OAMT) oamt,
IDT
FROM t1
WHERE code = 'NAQ.
GROUP BY GROUPING SETS ((dt, cd, pid, NUMBER, idt), NULL)

Kind regards
Karine

Tags: Database

Similar Questions

  • How do eliminate the password entry every time that I start

    How to eliminate the need to enter my word happening whenever I connect?

    Hello

    Please try:

    http://www.SevenForums.com/tutorials/377-log-automatically-startup.html

    Kind regards.

  • How to eliminate the paper on the window to appear of the old microsoft/qwest deal

    I have qwest (now century link) phone line DSL.  Qwest was an agreement to host with MSN email which ended.  However, whenever I am on a Web site with a link to click on send the company or the person on the Web site, the 'old window' opens to qwest/msn to connect to read emails.  The happesn of thing even if I go into file, send a link so that on a section of the Web site I want to send to others.   I can access my email on internet explorer or firefox hotmail account and have no problem using it.  I just want to know how to eliminate the Qwest/Msn link that is still on my computor

    You will find support for Windows Live Hotmail in these forums: http://windowslivehelp.com/forums.aspx?productid=1 [1]

    ===================================================
    [1] your * address email is removed from the privacy * account is still valid and is accessible via the webmail Hotmail page: www.hotmail.com

  • How to eliminate the blue HP page with the F keys, hand, photos, music started

    With Windows Vista 64-bit, how I eliminate the HPO start with items described above page?

    I'm sorry, but disabling the HP logo screen is accessible neither BIOS nor Windows configuration. He is tattooed in DMI.

  • After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    You can batch process using the image processor script and no user action should still be included in the process.  Check out our menu file > Scripts > image processor.

  • How to eliminate the pop-ups continued safety warning

    I get local security warning every time I change screens, how to eliminate this?

    It is a problem with the design of the Web site you are looking at. You can change the security settings for the Internet Zone to prevent the following message is displayed, but this may affect the functionality of the Web site or reduce your security depending on the option you select.

    More details are available in this article:

    http://blogs.msdn.com/b/ieinternals/archive/2009/06/22/HTTPS-mixed-content-in-IE8.aspx

  • How to eliminate the need for a password or fingerprint reader to open the computer?

    I wish that my pop just on computer without the using a password or fingerprint reader. I implemented the fingerprint reader, but I don't remember setting up a password so I would just eliminate the need for the fingerprint reader. I know that this makes my computer more vulnerable but I live alone and when someone is more, my children or friends, I wish they were able to get on my computer without calling me more to scan my fingers again and again. I implemented the fingerprint as a fluke reader just to see work and then couldn't figure out how to remove the drive without setting up a password. That's what he said to me when I try to remove the traces of fingers.

    It, S VERY SIMPLE... Click (windows icon) in the lower left corner (which is to start windows), and then select Control Panel and select user accounts. you will see your account name to simply select the option to remove your password and when you restart computer it will start just to the top with you having to connect. bettr to do for your children is for when you go to user accounts is to select Create new account name whatever you want for children do not assign a password to it and make sure that it is just a regular user account and not an administrator account on this way they can't remove anything or make changes to your computer that could damage the operating system. You should really think about it b4 you just let em have a complete control over it.

  • [JDev ADF] How is made the ' where clause ' default display criteria "all searchable attributes?

    Hallo,


    on a view object, I create my view of the criteria customized; I'm going to use it to create a "query with the table panel.

    I wish that his beahviour, when I use it to create a "query with the table panel", corresponds to that of "attributes searchable all.

    Unfortunately I'm having some trouble in his creation and I would like to see how is made the "object view where Clause" CV "all searchable attributes.

    My VO motion is:

    Select the username, name, RegisteringDate

    I would like to create my VC in a way that is the result "query with table Panel:

    UserId | ___ |

    Name | ___ |

    RegisteringDate of | ___ | to |_________|

    For each search field, I set a variable binding (PName, PUserId, PRegisteringDateTo, PRegisteringDateFrom).

    Each field must be used in the "query with table Panel" only if it is filled with a value.

    You kindly help me?

    Thank you very much

    F.

    The criteria to view all searchable attributes is implied all the attributes of a vo. Each attribute is used unless you specify a value for it. The problem with this IS, is that you can not change it.

    However, you can build your own RESUME that works in the same way, but allows you to change certain attributes. To do this, you create a new business card and add each attribute, select the operation you want to test the attribute against (equals, start by,...). You do not bind variables for attributes specify. The framework will add them for you automatically.

    The only thing that can not this vc is check varies as you want to do when you check "RegisteringDate." To do this you must use bind variables.

    Once you have create this EGG and it makes you drag onto the page you can use it as the "all attributes searchable.

    Timo

  • How to eliminate the cutters of rendering JavaScript and CSS in content above both

    Google suggests to increase the speed of loading my page www.oldeworldelace.com/index.htm I should 'eliminate cutters of JavaScript and CSS rendering in the above content both'. How I do the PCOC?  I would like your advice.

    Markup (HTML) and style (CSS) rules are needed for a page. Most of the client scripts (JS) are not required to display a page. So JS files should only be included at the end of the page where loading the same will not impede rendering page.

  • How to eliminate the ticking noise between the videos in my sequence?

    Hello.

    I worked with Adobe Premiere in the CC for over six months now.  For no reason at all, today I noticed that some footage that I did clicked in both.  Noise was always between any part of the sequence where the two videos were separated at least two seconds of empty space.  I'm not sure why this is happening and how to eliminate it?  I get rid of the noise in a video, but it was because I got rid of empty space and close my videos on the sequence.  However, I don't want to do every time I edit a video.

    I have updated all my applications CC and not sure what to do.  This problem occurred only in the last day and if anyone has the answer, please help!

    Thank you!

    Try this:

    http://forums.Adobe.com/message/5998928

  • How to generate the HAVING clause?

    Hi all

    When I add a function like the SUM, the code generates the "group by" clause by default. I also want to generate the clause "have" about it, how to do this in ODI?

    -Ian.

    Hello

    In your interface drag and drop the source column in the Web for which you want to generate the HAVING clause.
    It will create filters for columns. Now use the aggregation works like SUM, MIN, MAX, AVG etc. in this filter query.

    The generated code will now contain the inside HAVING clause.

    Thank you
    Fati

  • How to eliminate the reflection of camera Flash photography?

    I use PSE 6.0.  In none of the two instructions manuals that I use they specifically deal with how to eliminate a camera flash reflection in the photo.  I'm sure that there is a way to do it in PSE6.0, but I don't know where to look.  Can someone direct me?

    Thank you.

    Larry,

    There is no information in the field of flash reflection - it is completely blown. The Clone Stamp tool will not give a satisfying result, as the details in the contrast of lack of adjacent card area, especially in this file low resolution.

    I experimented a bit-

    • I tasted the brown color next to the flash with the eyedropper tool
    • Created a new empty layer on top of the stack
    • Accessed the tool brush, selected the library "Dry Media brushes", used brush #60 (Soft Pastel large) set at 25% opacity, then on the blank layer painted on flash area. That looks not too bad, but it lacks the detail of the map
    • Maybe you can print this, fill in the map by hand, then scan even.

    Someone else can come up with another suggestion.

  • How to eliminate the split after the restoration of browser screen?

    FF 29.0.1 running on OS x 10.8. From time to time, from FF (after killing him) and the restoration of all sessions, results in each window with tabs displayed in a split screen. The upper part is about 4 "high, followed by a seam, then the site itself. Resizing can completely eliminate the useful portion--unable to shrink beyond the joint.

    Open a new tab results in a screen divided; Open a new window appears normally.

    The problem occurs only after the restoration of the tabs - never when FF is normally closed.

    Suggestions?
    Thank you.

    Hi nxtr, your test Mode without fail gives strongly suggests that one of your extensions is to create the gap.

    If you have not checked recently updates to the extension, you can do it from the page modules. Either:

    • Command + shift + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then, above the list, click on the "gear" button Check for Updates.

    If they are already up-to-date, you can try to disable selectively non essential. I hope that the problem is caused by one of.

  • How to eliminate the buffer?

    Hello!

    When I started using this computer which has Windows Vista installed top, videos do not put in the buffer.  For some unknown reason, the videos now buffering.  Sometimes they take a long time to start, due to the buffering.  The buffering also usually occurs every few seconds while I watch a video.  I find it extremely annoying, frustrating and very time consuming.  I find myself minimizing the video and let it run for the first time without my watch.  When I play, there is no buffering.

    Any help you give me will be greatly appreciated.  I need instructions to be as clear as possible, however, because I am not very well informed about the software.  Thank you very much.

    Hello!

    When I started using this computer which has Windows Vista installed top, videos do not put in the buffer.  For some unknown reason, the videos now buffering.  Sometimes they take a long time to start, due to the buffering.  The buffering also usually occurs every few seconds while I watch a video.  I find it extremely annoying, frustrating and very time consuming.  I find myself minimizing the video and let it run for the first time without my watch.  When I play, there is no buffering.

    Any help you give me will be greatly appreciated.  I need instructions to be as clear as possible, however, because I am not very well informed about the software.  Thank you very much.

    ========================================
    Buffering can be caused by several factors... slow connection
    speed, net congestion, high traffic on the host server, the server
    could be located to halfway around the world to name a few.

    If you have to play the file once before you can see without
    buffering is because the first time in the file is
    Downloaded (copied) in your Temporary Internet Files folder.

    Once in the TIF folder, you can view the file like any other
    a file that is stored on your hard drive.

    Delete the contents of your TIF folder could be useful to try:

    Take a look at the following articles:

    Windows Vista-
    Delete temporary Internet files
    http://Windows.Microsoft.com/en-us/Windows-Vista/delete-temporary-Internet-files

    Windows Vista - delete files using disk cleanup
    http://Windows.Microsoft.com/en-us/Windows-Vista/delete-files-using-disk-cleanup

    How to view the Internet
    Temporary Internet Explorer
    Files and settings in Vista
    http://www.Vistax64.com/tutorials/94239-Internet-Explorer-temporary-Internet-files-settings.html

    Also... it may be interesting to try to increase the size of your virtual memory paging file:

    Windows Vista - change the size of virtual memory
    http://Windows.Microsoft.com/en-us/Windows-Vista/change-the-size-of-virtual-memory

    Good luck...

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How to find the Union between the column in the table

    Hello

    I have the followin table and I want to find the union between the lines as below,
    create table test5 (tidset varchar2(200));
    
    insert into test5 values('1;2;3;4;5;6;7;8;9;10;11;12;13;15;16;17;18;19;20');
    insert into test5 values('1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20');
    insert into test5 values('1;2;3;4;6;7;8;9;11;12;13;15;16;19;20');
    insert into test5 values('1;4;6;10;6;11;12;13;14;15;16;17;18;19;20');
    I need the result to be as below.
    1;4;6;11;12;13;15;16;19;20
    any help please,.

    Published by: user11309581 on November 17, 2011 21:32

    Always mention what version of oracle you are using.

    The following query will give you the desired result oracle version 11g release 2.

    Connected to Oracle Database 11g Release 11.2.0.2.0 
    
    SQL>
    SQL> with test5 as
      2  (
      3  select '1;2;3;4;5;6;7;8;9;10;11;12;13;15;16;17;18;19;20' tidset from dual union all
      4  select '1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20' from dual union all
      5  select '1;2;3;4;6;7;8;9;11;12;13;15;16;19;20' from dual union all
      6  select '1;4;6;10;6;11;12;13;14;15;16;17;18;19;20' from dual
    -- "END OF SAMPLE DATA"
      7  ), all_items as
      8  (
      9    SELECT regexp_substr(t.tidset, '[^;]+', 1, column_value) item
     10          ,t.tidset
     11      FROM test5 t
     12          ,TABLE(CAST(MULTISET
     13                      (SELECT LEVEL
     14                         FROM dual
     15                       CONNECT BY LEVEL <=
     16                                  length(regexp_replace(t.tidset, '[^;]')) + 1) AS
     17                      sys.odcinumberlist))
     18  ),item_counts as
     19  (
     20    SELECT DISTINCT a.item
     21                   ,COUNT(DISTINCT a.tidset) over() total_tidset
     22                   ,COUNT(a.item) over(PARTITION BY a.item) item_occurance_count
     23      FROM (SELECT DISTINCT item
     24                           ,tidset
     25              FROM all_items) a
     26  )
     27  SELECT listagg(item, ';') within GROUP(ORDER BY to_number(item)) common_items
     28    FROM item_counts
     29   WHERE total_tidset = item_occurance_count
     30  ;
    
    COMMON_ITEMS
    --------------------------------------------------------------------------------
    1;4;6;11;12;13;15;16;19;20
    
    SQL> 
    

    OR if you have any version of oracle less than 11g release 2 then replace below mentioned line

    SELECT listagg(item, ';') within GROUP(ORDER BY to_number(item)) common_items
    

    with this one

    select xmlagg(xmlelement(c,item||';').extract('//text()') order by (to_number(item))) common_items
    

    It is because the listagg function used in above query is not supported in versions of oracle 11.2 below.

    I hope this helps.

    -Gregory

    Published by: Mohamed Diarra on November 18, 2011 01:05
    Extra line to be changed for the oracle version lower than 11.2

Maybe you are looking for

  • MacBook Pro mid-2012 running hot (MacOS Sierra)

    Hello I have a MBP mid-2012 13 inch with 16 GB. of ram and a 500 GB. SSD I had it set up with boot camp and dualboot El Capitan and MS-Windows-10 Everything is working, all the features and functions in the two operating systems. I was very pleased w

  • Start Mac mini on the brink

    Hello. My 2010 mini Mac on Os 10.4 Power PC which was working fine until today. Now, it freezes at startup (continuous color ball runs indefinitely). Can be helped?

  • Re: Unable to block unwanted calls.

    I get calls from SKYPE robot. He told me that my system works well and that I need an anti virus system for my iPad 2. He won't quit. My Apple cannot use an anti virus program or I would get a free. They don't have anything ring me several times a da

  • OfficeJet 6210: Officejet 6210 do print after upgrade to 8.1 Windows

    I've reluctantly Windows 8 upgraded to 8.1.  And now, my Officejet 6210 not print.    When you are prompted to print, the printer icon appears in the toolbar showing employment is printing, or, a message appears indicating printing, but nothing print

  • New folder or subfolder

    I have more 'add a new folder' or 'Add new subfolder' in the drop-down list of drives or folders. It's something that just happened. The choice is now to add new "portfolio" and add new "compressed (zipped) folder." No idea what caused this change? T