Solution for this but in single query without using  subquery and all

My Table Structure be like this
empid sal
100 5000
200 3000
300 2000
400 1000
I want the ouput like this
empid sal Running Total
100 5000 5000
200 3000 8000
300 2000 10000
400 1000 11000

You mean something like
select empno, sal, sum(sal) over (order by empno) from emp order by empno
EMPNO,SAL,SUM(SAL)OVER(ORDERBYEMPNO)
4444,,
7369,100,100
7499,200,300
7521,100,400
7566,100,500
7654,1250,1750
7698,2850,4600
7782,2450,7050
7788,100,7150
7839,5000,12150
7844,1500,13650
7876,1100,14750
7900,950,15700
7902,3000,18700
7934,1300,20000

Similar Messages

  • How can i fetch records from 3 tables in a single query  without using join

    Hi.
    Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b>
    Thanx
    prabhudutta

    Hi Prabgudutta,
    We can fetch the data by using the views concept.
    Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
    Views conatin the data at runtime only.
    Four different view types are supported. These differ in the
    way in which the view is implemented and in the methods
    permitted for accessing the view data.
    Database views are implemented with an equivalent view on
    the database.
    Projection views are used to hide fields of a table (only
    projection).
    Help views can be used as selection method in search helps.
    Maintenance views permit you to maintain the data
    distributed
    on several tables for one application object at one time.
    step by step creation of Maintenance view:
    With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
    It can be set in transaction SE11 - Tools - Table maintenance generator.
    Table maintanance Generator is used to manually input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under attributes tab
    2) utilities-table maintanance Generator-> create function group and assign it under
    function group input box. Also assign authorization group default &NC& .
    3) select standard recording routine radio in table table mainitainence generator to move table
    contents to quality and production by assigning it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers this dialog box appears when you click on create button
    6) save and activate table
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    SM30 is used for table maintenance(addition or deletion of records),
    For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
    Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
    It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
    In the SE11 delivery and maintenance tab, keep the maintenance allowed..
    Then come to the SM30 and then enter the table name and press maintain..,
    Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
    Then create,,,
    Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
    We use SM30 transaction for entering values into any DB table.
    First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
    Then it will create a View.
    After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
    Hope this resolves your query.
    Reward all the helpful answers.
    Rgds,
    P.Naganjana Reddy

  • I need solution for this query

    hi all,
    could anyone please send me solution for this query these are the database tables am having
    TABLE NAME :USERS
    ATTRIBUTES
    UNAME
    PASSWORD
    GROUPNAME
    TABLE NAME:GROUPS
    ATTRIBUTES
    GROUPID
    GROUPNAME
    my requirement is that i need 2 acces the groupname of a particular user and the reamining groups to which i doesn't belong in A SINGLE QUERY
    my result needs to be like this
    Authorised group
    consultant
    UNAuthorised groups
    sales
    vender
    recruiter
    admin
    if any body got the solution please send

    hi All,
    I have 3 tables 1)PREVILEGES (groupname, previleges(values y or n only))
    2)GROUPS (groupid, groupname)
    3) USERS (uname, groupname).
    Here each user belongs to one group, each user hav a default previlege means example if user is consutant then he can access only consultant group. Means default previlege will be used. For default previleges, there is no record in Previleges table.
    The Problem is that, I need to reterive the groupname from users which de doesn't belong as well as his previleges from previleges, If there is no values in previleges in the table it should return n. or value what is therey.
    the different groups are
    SALES,CONSULTANT,VENDER,RECRUTER,ADMIN

  • I have installed 2010 microsoft office 2010 home and business version for my laptop,and i have installed lync 2013.Now i want create online lync meeting from outlook,but i am unable view that lync icon in outlook.Please give me the solution for this que

    I have installed 2010 Microsoft office 2010 home and business version for my laptop,and I have installed lync 2013.Now i want create online lync meeting from outlook,but i am unable view that lync icon in outlook.Please give me the solution for this issue.
    Regards
    Raghavendar

    Hi Raghavendar,
    Generally, when you install Lync 2013 in the computer with Office 2010, a Lync Meeting Add-in will be installed and enabled in Outlook 2010. Please follow these steps to check it:
    1. In Outlook, click the File tab, click Options, and then click
    Add-Ins.
    2. Please take one of the following actions:
    If the add-in is in the Inactive Application Add-ins list, follow these steps:
    a. In the Manage drop-down list at the bottom of the dialog box, click
    COM Add-ins, and then click Go.
    b. Click to select the check box next to the add-in, and then click OK.
    The New Online Meeting button should now be available in
    Calendar View, and the Online Meeting button should be available when you create a new calendar item.
    If the add-in is in the Disabled Application add-ins list, follow these steps:
    a. In the Manage drop-down list at the bottom of the dialog box, click
    Disabled Items, and then click Go.
    b. Select the add-in, and then click Enable.
    c. Restart Outlook, and then verify that the add-in is displayed in the
    Add-ins dialog box.
    The New Online Meeting button should now be available in
    Calendar View, and the Online Meeting button should now be available when you create a new calendar item.
    3. In Event Viewer, view the Application log to see whether an error was logged for Outlook, for Lync 2013, the Lync Meeting Add-in for Microsoft Office 2013.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • TS1702 I use iphone5, I see an app update on the app store. but when App store and click on the update tab, it doesn't show me which application to update.. just give me a blank page.!!!! what is the solution for this.!!!!

    I use iphone5, I see an app update on the app store. but when App store and click on the update tab, it doesn't show me which application to update.. just gives me a blank page.!!!! I wouldn't able to know what app has to be updated, untill and unless i get check for each every app on the app store installed on my iphone... what is the solution for this.!!!! can any1 one help me out.!!!!

    Cc2528 wrote:
    The iTunes Store on my iPad is set up with all my music already. And at the very bottom it shows my apple Id username. The only place it shows the previous owners id is in the App Store...
    You can probably change the ID in the "iTunes and App stores" settings on the iPad....click on the wrong account ID , select sign out, then log in with your own ID, I have not done this but I think it works.....
    but I would be more inclined to to the factory reset and start afresh.

  • I have put Netflix on my Macbook Pro but Silverlight will not run. I receive a black screen that says "player error." Does anyone have a solution for this. Netflix support is not so hot.

    I have put Netflix on my Macbook Pro but Silverlight will not run.I receive a black screen that says "player error." Does anyone have a solution for this. Netflix support is not so hot.I can use Netflix straming thru my Blueray on my TV but it will not run on my Pro. Thanks

    Try running Safari in 32 bit mode.  In get info box for Safari,
    check open in 32 bit mode.  There have been some oddities
    on some systems that can cause some issues.
    I had thought MS had fixed this, but may not have.

  • I accidently removed my clash of king game from Game Center, but my profile is still there and i want it back. Any solution for this situation?

    I Accodently removed mu Clash of King game from Game center, but my profile is still there, I want it back.Any solution for this situation?

    Install the game again.

  • I have iPhone 4 and I have purchased this from Dubai and now I am in India but now my phone didnot working here .so plz give me solution for this so I will use this in India.can I factory unlocked my iPhone by apple store at jaipur india

    I have iPhone 4 and I have purchased this from Dubai and now I am in India but now my phone didnot working here .so plz give me solution for this so I will use this in India.can I factory unlocked my iPhone by apple store at jaipur india

    ONLY the carrier it is locked to can authorize unlocking it. Most have restrictions in that you must be a current customer and have maintained service for a minimum period of time. Do yourself a favor, sell it and purchase a phone in India instead.

  • I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    @I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?

    how can we solve the problem?
    I have my adob.e ID, downloaded Adobe Digital Editions.
    Whren I download EPUB-ebooks and want to use
    Digital Editions, nothing happens and appears!??
    Please give me a short feedback and help

  • Buy second hand iPhone ........... i have apple id of previous owner but no password ... now the phone is in icloud activation mode . any solution for this.

    i buy second hand iPhone from Olx ........... i have apple id of previous owner but no password ...
    now the phone is in icloud activation mode . any solution for this.
    totally wastage of money , if there is no solution .
    for security purpose this icloud activation is Good ............

    Read this
    http://support.apple.com/kb/TS4515?viewlocale=en_US&locale=en_US

  • I transfered a picture folder to my tc and now it occupies space on the tc but I can't open it. I there a solution for this?

    I transfered a picture folder to my Time Capsule (3Gbit) from a external USB, drive thru my Macbook Pro, and now it occupies space on the Time Capsule  but I can't open it. Is there a solution for this?

    This is super fun with Yosemite.. that cannot open files on network drives..
    Have you got the drive mounted in Finder?
    Try and change the permissions of the folder in TC.. but I am not sure you are going to find this easy.
    I think the best way to fix this is to copy the whole lot back to the external USB via the terminal using a full root login.
    So open terminal.. type sudo su
    Type in your main administrator password.
    Then you can use any of the command line copy tools.. I have just done this with rsync..
    The command is rsync -av /source/* /destination/
    You should mount both the source and destination in finder.. and you can then drag the folder into the command line.. it will then copy the exact source and destination you want.

  • TS1389 Repeatedly prompts of authorize this computer but there is no solution for this & it still prompts authorize this computer. Please suggest me another solutions

    i tried above all sugget to prevent repeatedly prompts of authorize this computer but there is no solution for this & it still prompts authorize this computer. Please suggest me another solutions

    Hello Kuldip13,
    It sounds like iTunes keeps asking you to authorize the computer. If you have already tried all the steps within the article you came from:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/TS1389
    I would next check to see if the same Apple ID is signed into, that was used to play these purchases with this article:
    Recovering a forgotten iTunes Store account name
    http://support.apple.com/kb/ht1920
    Open iTunes
    Highlight one of the items you have purchased (You can find your purchases in your Purchases playlist).
    Choose File > Get Info.
    Click the Summary tab.
    The Account Name area will list the account used to purchase the item. Unless you have changed accounts, this is your iTunes Store account name.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Hi. my laptop was reformatted recently, and my itunes there erased. i created a new one but the problem is it doesn't sync with my ipod anymore. what is the solution for this? can someone give me a tip? will really appreciate. thanks

    hi. my laptop was reformatted recently, and my itunes there erased. i created a new one but the problem is it doesn't sync with my ipod anymore. what is the solution for this? can someone give me a tip? will really appreciate. thanks

    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Hi Apple! My iphone 4g has restored and I can't retrieve the account. I have tried the password renewal that will be send on my mail but unfortunately my mail has been deactivated also.what is your solution for this kind of cases? This is so unfair.

    Hi Apple! My iphone 4g has restored and I can't retrieve the account. I have tried the password renewal that will be send on my mail but unfortunately my mail has been deactivated also.what is your solution for this kind of cases? This is so unfair.

    http://support.apple.com/kb/HT5312
    If you established a rescue email address, there will be a link on the "Passwords & Security" page of id.apple.com.  Clicking the link will send the reset to your rescue email address (NOTE:  This is not the same address as your Apple ID email)
    If there is no link on the page, then you didn't establish a rescue email address.  Contact AppleCare at 800.694.7466, and ask for account security.  You will need to answer some questions to verify your identity, AND you will need access to a computer to generate a temporary support pin.
    HTH

  • When i connect my iphone 4,an error message saying usb device is malfunctioning is appearing...can anyone give me a solution for this?

    when i connect my iphone 4,an error message saying usb device is malfunctioning is appearing...can anyone give me a solution for this?i tried using on a different pc.but still get the same result..

    First thing i would try is to use another cable if available.

Maybe you are looking for

  • Submit to SAP button

    Hi folks, Would like to know, how 'Submit to SAP' button working in Adobe interactive forms.how this button is synchronised with outlook(IXOS server). For example, if a travel request created, click on this button it will take us to a new mail with t

  • Unable to start admin server. Below is the error I get.

    Unable to alter the process. Unable to execute action 'start' on server 'idc'. Please check the error logs for a full description of the error. IdcAdmin: Event generated by user 'sysadmin' at host 'localhost'. Unable to alter the process. Unable to e

  • Opening CS4 32bit  from Lightroom 2 64 bit

    I am using Lightroom 2.6 64bit on a Windows 7 64bit PC. I have both 32 & 64 bit versions of Photoshop CS4 installed. I need to use the 32 bit version of CS4 as I have plugins that will not work in the 64 bit version. When I try to open a file for edi

  • Airplay vs. Bluetooth

    If I want to play music only from my iPod Touch, iPhone4 or MacBook Pro (mid-2010) to a remote speaker . . . is there any advantage to Airplay over Bluetooth?

  • Processing of messages

    Hi all continuing with my posts for today i would also like to know how and in which formats the messages are transformed under different level. your help in req for me to understand on this topic. thkx chako