Dont want to use group by with sum function..

Hi all
I am using sum function but i dont want to use group by since my query give me following output which i dont want I want.
0------------22---------(null)     Furniture
0-----------     3700------     (null)     अनपेड बिल्स देणे
15800-----14202-----(null)     Petty Cash
(null)------     (null)------ 9109     Furniture
(null)------ (null)------ 1789     Petty Cash
(null)-------(null)------ 0     Checking In-Transfer
I want like
0------------22---------9109     Furniture
0-----------     3700------     0     अनपेड बिल्स देणे
15800-----14202-----1789     Petty Cash
what should be the problem how I can handle the query my query is
select  null as totalcr, null as totaldr, (sum(acct.amtsourcecr)-sum(acct.amtsourcedr)) as opening , ev.name as accountname
from fact_acct acct right OUTER join  c_elementvalue ev on acct.account_id= ev.c_elementvalue_id
where acct.dateacct < '01/04/2010'
and ev.cr_account_base=2
group by ev.name
UNION
select sum(acct.amtsourcecr) as totalcr, sum(acct.amtsourcedr) as totaldr, null as opening
*,ev.name as accountname*
from fact_acct acct right OUTER join  c_elementvalue ev on acct.account_id= ev.c_elementvalue_id
where  acct.datetrx BETWEEN '01/04/2010' and '01/04/2010'
group by  ev.name
if I remove group by it shows me error .....not a single group by function ...
please help me out ,,,
thanking you

This is one way you can do it without a group by:
SQL> with t as
  2    (
  3      select 0 amt1, 22 amt2, null amt3, 'Furniture' tag from dual union all
  4      select 15800,14202,null, 'Petty Cash' from dual union all
  5      select null, null, 9109, 'Furniture' from dual union all
  6      select null, null, 1789, 'Petty Cash' from dual
  7    )
  8  select tag, amt1, amt2, amt3
  9  from
10  (
11    select sum(amt1) over (partition by tag) amt1
12          ,sum(amt2) over (partition by tag) amt2
13          ,sum(amt3) over (partition by tag) amt3
14          ,first_value(t.tag) over (partition by t.tag order by rownum) tag
15          ,row_number() over (partition by t.tag order by rownum) rn
16    from t
17  )
18  where rn = 1
19  /
TAG              AMT1       AMT2       AMT3
Furniture           0         22       9109
Petty Cash      15800      14202       1789

Similar Messages

  • I dont want to use adobe catalyst with my adobe muse forms!

    I dont want to use adobe catalyst with my adobe muse forms!
    I dont want to use third party plugins... Why? When I already bought Adobe Muse.
    I just want to create a form in MUSE and have it simple and working - without catalyst.

    So its really very good news for me, I will try it this week.
    Thanks a lot mac_heibu, sorry for mismatch information.
    You made my day, bro.

  • How can I sync my Microsoft Outlook tasks with my Ipad reminders? I dont want to use Icloud or an exchange

    How can I sync my Microsoft Outlook tasks with my Ipad reminders? I dont want to use Icloud or an exchange

    Plug it into your computer. Tell it to sync with "this computer" instead of iCloud. You shouldn't have to remove any apps. Otherwise, you can save the app data by using i-FunBox ( http://www.i-funbox.com/ ) just go to the "devices" tab and select 'user applications' and select all of your apps and tell iFunBox to "copy to pc" you're done! You have them all backed up.

  • Logical database EQI (equipment)  .. I dont want to use the default selecti

    i am using Logical database EQI (equipment)  its realated to PM module.....
    i dont want to use the default selection screen.
    instead i want to process my own selection screen inputs..
    (ie..) i want to fetch the data using the GET event using my  own selection screen  inputs.
    my selection screen inputs is   equipmentnumber (equnr)
    and  the output list : 1.equnr      "equipment number
                                  2.shtxt       "Equipment Description
                                  3.tplnr        "Functional Location
                                  4.pltxt        "Functional Location Description
                                  5.qmnum    "Notification Number 
                                  6.qmtxt      "Notification Description
                 and  so on  ..........             
    how to do this ... can any one give sample code... or logic

    Hi Victor,
    I have a simple solution for this.i think it will help you.Do u have any idea about query designer in SAP.
    by using it we can satisfy u r  reuqirement.follow the below steps.
    1)Go to SQ01
    2)In the screen click on QuickViewer option.then you will go to another screen.
    3)In that screen give any name starting with 'Z' in the QuickView box and then click on create.
    4)In the dialogbox enter title and comments and then select LogicalDatabase as the DATASOURCE and give DataSourceLogicalDatabase as EQI.check the radio button Basis Mode and then click on ok.
    5)then on the screen in the first half of leftside you will  get another screen with the columns DATAFIELDS,LISTFIELDS,SELECTIONFIELDS,TECHNICALNAME.
    6)In the DATAFIELDS column expand the tree,then u can see the fields what we have,and what you want.and also you can see the check boxes in front of the columns LISTFIELDS,SELECTIONFIELDS.
    7)LISTFIELDS means the output fields,SELECTIONFIELDS means the selection screen fields(equnr).
    check the checkboxes as per u r requirement and click on execute.
    8)then a progam will be created.to know the program name after executing the program GO TO
    SYSTEM->STATUS.then u can see the program name there.
    If u know all these,let me know so that i can try for another solution.
    Thanks,
    N.K.C

  • How can my ipad work in the caribbean if i dont want to use my current provider

    How can my ipad 4 work in the caribbean if i dont want to use my current UK provider.
    I am travelling to the Caribbean, will I be able to buy a sim card there to use over there for wifi.

    UK-sold iPads are not locked to a carrier, so you should be able to use your iPad with any carrier that offers compatible service and an iPad data plan.
    Regards.

  • TS1292 I redeem my code and it wont let me by the music i want  i have money on the card an i would  like to use it please. i dont want to use my ceredit card i  want to use my gift card

    i reedeem my gift card an it wont let me buy  my music i dont want to use  my ceredit card i have  money one my gift card an i would  like to use it please

    To migrate your phone to a new account, start by saving any photo stream photos that you want to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If you are syncing notes with iCloud that you want to keep on the phone, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; your other devices won't be effected by this), provide the password to turn off Find My iPhone (if using iOS 7) and choose Keep on My iPhone when prompted .  Then sign back in with your new Apple ID to create your new account and choose Merge to upload your data to the new account.

  • I have changed the apple ID (email, but on my iphone , the icloud is stil asking me to log in whit the old email.And it is poping-up on every 10 seconds.I never used icloud, and i dont want to use it.I just dont know how to disable the icloud.

    i have changed the apple ID (email) but on my iphone , the icloud is stil asking me to log in whit the old email.And it is poping-up on every 10 seconds.I never used icloud, and i dont want to use it.I just dont know how to disable the icloud.

    If you see that pop up you enabled icloud. Whether you want or do not want now to use it irrelevant until you actually disable activation lock.
    In order to do that you have to change your apple id back to do that just long enough to sign in and back out. System will ask you to verify, don't.
    Just sign in on the prompt you getting and then logout. Once done, change apple id to what you have now and verify. Then decide if you want to
    use icloud (who does not want to be able to track their phone if lost or stolen).

  • I bought the iphone 4s about a year ago, he was not new. The seller told me that he did the factory unlock, but he lied. Now I live in Russia and want to use the iPhone with a local GSM sim card.

    I bought the iphone 4s about a year ago, he was not new. The seller told me that he did the factory unlock, but he lied. Now I live in Russia and want to use the iPhone with a local GSM sim card. Serial number (removed), IMEI (removed). Thank you!
    Personal info removed to comply with the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

    Edge has very clear restrictions, one being that you must have 6 months of clean payment history which you don't. Either wait until April 14, or good luck at Sprint.
    I am unsure how it can be determined the payment mix up was the fault of CS, but regardless, the mix up was done. There can be any number of reasons why a payment could be missed without any fault on your part, however you are still the responsible party for the account and must live with the repercussions.

  • Safari on windows stinks but I dont want to use chrome as all my bookmarks and passwords are on safari now

    Safari on windows stinks but I dont want to use chrome as all my bookmarks and passwords are on safari now, but im finding now i use chrome on my os devices justso that my windows computer at work is useful.. Why wont apple support safari for user like mew who want to use it

    Apple dropped support for Safari for Windows several years ago. Try Firefox.
    Firefox

  • SwiftKey Keyboard crashes every time i try to fill a textfield in a website (i test some different sites). But it works if i use the standartkeybord from android, but i dont want to use any other key than SwiftKey. Please BugFix the problem.

    HTC Desire
    Android: 2.2 (stock)
    Build: 2.29.405.5
    KeyBord: SwiftKey (newest version)
    Every time i try to fill a textfield on a homepage swiftkey crashes. But i can type in a internet-adress without any problems. If i use any other Keybord all work fine, but i dont want to use any other Keybord than SwiftKey.

    Thanks for the report. We are working on this problem; for details see https://bugzilla.mozilla.org/show_bug.cgi?id=617298

  • I want to use the iphone4 with local GSM providers in Nigeria

    I have an iPhone4 which I bought as a pay-as-you-go from O2 in England (UK). But now I have moved to Nigeria. I want to use the iphone4 with local GSM providers. How do I go about it? Please help.Thanks.

    You contact o2 as they are the only ones who can unlock the phone for you.

  • Want to use credit card with firefox but do not see a lock with firefox 5 on linux using priceline

    want to use credit card with firefox but do not see a lock with firefox 5 on linux using priceline

    Type '''about:preferences#applications'''<enter> in the address bar.
    Now follow the picture.

  • Basic Photoshop 101: I want to use an image with an outer glow in another Photoshop document. When I place the image, the outer glow has hard edges where the box of the image cut the glow off. Naturally, I want a soft feathered outer glow. How do I get th

    Basic Photoshop 101: I want to use an image with an outer glow in another Photoshop document. When I place the image, the outer glow has hard edges where the box of the image cut the glow off. Naturally, I want a soft feathered outer glow. How do I achieve that? Thank you.

    That should work out, maybe edit it to force updating in the new image.
    Could you please post a screenshot with the Layers Panel visible?

  • HT201269 ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud.

    ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud. i would actually like to just plug it in to the usb drive the old fashioned way

    I don't believe the iOS7 update was the cause for your issue. I have three devices all updated and they all show the Import To drop menu in Image Capture as shown below.

  • Want to use bluetooth speakers with volume control, don't want the iPad internal speaker sound, is this possible?

    want to use bluetooth speakers with volume control, don't want the sound at the iPad internal speakers, only on the external speakers.  is the possible? and how

    You can't downgrade the iOS.
    Take it to an Apple Store for evaluation.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

Maybe you are looking for

  • I can't delete my bt emails or move them to folders, other emails from tiscali no problem with, anyone help please

    I can't delete my bt emails or move them to folders, other emails from tiscali no problem with, anyone help please

  • Endpoint URI

    Hello, we are using AS2 connectivity I have some doubts when I am providing transport server parameters for remote TP I am provided with following relmote TP http URL URL=http://as2-fs.preprod.1sync.org:9080/exchange/0614141800001 Now can I set Trans

  • Scanner software for lion os?

    I need Microtek Artix F1 scanner software for Lion. Any suggestions?

  • Crystal Reports has stopped working

    I just installed Crystal Reports 2013. I am using Windows 7. The program opens up and everything looks normal but when I open a blank report and try to create a new connection, it immediately gives me the error "Crystal Reports has stopped working" a

  • Need to know how to export long description

    Dear All, We have some clients on 2007 and 8.8. They have some long description in SAP the format is XXX YYYY ZZZZZZZZZ However, when we export to excel, it changes XXXYYYYZZZZZZZZZ Is there a way we can setup in excel to make it in multiple lines as