amount without using 2 selects

How can I achieve this without with 2 queries to calculate the sum buys and sells?

BANK TOTAL_SHARES

----- ------------

BANK1 30

BANK2 25

20 BANK4

BANK5 20

BANK3 15

Script to test

create table test (varchar2 (5) buyer, SELLER varchar2 (5), actions numeric (10));

insert into test values ('BANK1', "BANK1", 10);

insert into test values ('BANK1', "BANK2", 10);

insert into test values ('BANK3', 'BANK2', 15);

insert into test values ('BANK4', 'BANK5', 20);

commit;

Select the Bank, sum (shares) total_shares of

(

Select the Bank of the buyer, sum (shares) shares of the test by the buyer group

Union

Select the Bank of the seller, sum (shares) shares of the test by the seller group

)

Bank Group

total_shares desc order, Bank;

Thank you very much!

Tags: Database

Similar Questions

  • ADD THE AMOUNT WITHOUT USING THE COMMAND

    Hi 2 all...

    the table contains:

    UID billno amount
    1 101 100
    2 102 200
    3 103 300

    the o/p should be:

    UID total amount billno
    1 101 100
    2 102 200 300
    3 103 300 600

    I need the query for this pblm without using the command... Please advice... can someone send immed... Thanks in advance...

    If you still don't bother to write in proper understandable English or probably your keyboard is broken.

    Anyway you can do this

    SQL> WITH t AS (
      2  SELECT 1 col_uid, 101 billno, 100 amount FROM DUAL UNION ALL
      3  SELECT 2, 102, 200 FROM DUAL UNION ALL
      4  SELECT 3, 103, 300 FROM DUAL)
      5  -- end test data
      6  select col_uid, billno, amount, decode(amount, amount_cum, null, amount_cum) amount_cum
      7    from (
      8  select t.*, (select sum(amount) from t t1 where t1.col_uid <= t.col_uid) amount_cum
      9    from t)
     10  /
    
       COL_UID     BILLNO     AMOUNT AMOUNT_CUM
    ---------- ---------- ---------- ----------------------------------------
             1        101        100
             2        102        200 300
             3        103        300 600
    
  • multiple selection in listbox without using the ctrl key

    Hello

    I wanted to know if it is possible to select multiple items in a listbox without using ctrl or SHIFT key. I write code for a touch screen application and you want to activate the user select more than one entry in a listbox control.

    I saw a similar post that had a solution for a tree control. Is it possible to do the same thing for a listbox control too?

    Pavitra-

    I saved to the audit zip file previous version

  • Can change us line selected in ADF without using click to edit table feature.

    JDEV 12.1.3.0

    Hi Experts,

    Is there a way we can select a row in the table and click the button change the Panel collection. While the row becomes editable.

    Whatever row, we select and click on the edit button. This line becomes editable thattime only. Otherwise always disabled.

    Without using click to modify the ADF table feature.

    Thank you

    AR

    I had similar usecase

    Maybe you can tweek this blog to meet your needs

    Born in DeBug: press the Edit button to make editable line Table.

  • by selecting each of the nth order key without using a rank value

    Hello

    Suppose we have a table of Orders

    create table orders)

    order_no number primary key,

    customer_id number,

    item_id number);

    insert into orders)

    Select 101, 601, 90 of all the double union

    Select 103, 602, 100 of all the double union

    Select 603, 105, 110 Union double all the

    Select 107, 604, 120 Union double all the

    Select double union all 108, 605, 130

    Select double union all 109, 606, 140

    Select 110, 607, 150 Union double all the

    Select 111, 608, 160 Union double all the

    Select 112, 609, 170 Union double all the

    Select 114, 610, 180 doubles);

    How can we take every third order_no controlled key order_no without use of rank and connect function using sql.

    as

    105,

    109,

    112

    can someone please help?

    Thank you

    Max

    How can we choose each third order_no order_no keys without the use of grade -controlled

    Reason is?

    Anyway, using ROWNUM then:

    SQL > select order_no

    2 starting at)

    3. Select order_no, rownum rn

    4 of)

    5. Select order_no

    6 orders

    7 order of order_no

    8    )

    9)

    10 where mod (rn, 3) = 0;

    ORDER_NO

    ----------

    105

    109

    112

  • Insert data into the table without using the insert or select the command

    Hello

    Is there anyway to insert data from one table to another table, without using insert, and then select the command in the same pattern.
    Note: the two tables have the same structure.

    ALTER table... Swap partition...

  • How to publish an application to a group of selected people without using the content viewer Adobe?

    How to publish an application to a certain group of people (not via the App Store) without using the content viewer Adobe?

    The application was developed with InDesign 6.0

    You will need to register for Apple Developer account and then gather all the UDID (Apple this limit to only 100 devices) you want to your application must be installed on. Create your mobile configuration profiles to include these ID's and you can then use TestFlight to get your app and the monitor that installed it. Of course Testflight is intended to monitor the performance of your apps, but I'm sure you can get away with it if you use it to push you app. One thing to keep in mind is that the mobile profiles provisoning are valid for 1 year. I hope this helps.

  • Can I transfer a ringtone from my pc iMac to my iphone without using iTunes?

    I have ringtones, I created to AAC format on my iMac and would like to transfer on my wife's iPhone without using iTunes. Unfortunately, my use of the woman, a Windows 10 laptop and it will not acknowledges his iphone when it opens iTunes. I connected the phone to my iTunes on my iMac using his account, but he asks me if I want to backup my iPhone or a new phone. If I click on new phone, it resets the phone to the factory settings? / any help would be gratefully appreciated... Thank you.

    It will not reset the phone by selecting new phone

    but when Sync you the phone with your iTunes library will overwrite you its multimedia files > music & video synchronized to its own iTunes library on PC

    Follow these steps to get his device connected to your PC - iPhone, iPad, or iPod not recognized in iTunes for Windows - Apple Support

    No way to get ito on device with iTunes unless you use Garageband on the iOS device?

    Garage band can record ringtones on iOS

  • without using DAQ how a PID controller for temperature control

    Mr President.

    IAM trying to make a PID controller for temperature control in labview. But I have no devices data acquisition. Then without using DAQ how a PID controller.please suggest some useful block diagram.plz give me an answer. I tried one, but not working.below attached is my work.

    as a learning exercise, some devices can be simulated in the Explorer to measure (performance measure explore, right click on devices, select Create new.) Select simulated device and choose your device, you can search by product code for example 4070 for a dmm)

    I hope this helps you begin to learn labview, depending on how advanced you can I strongly suggest looking in training of core 2 and core 1 but also by looking at the examples that come with labview

  • What is a quick way to exit Windows 7 without using the mouse?

    On Windows XP, I could type the window then u and U key to exit.

    On Windows 7 I seem to need the mouse to exit, even if I did stop my setting of the default button.

    In addition, Windows 7 wants to drag me through a few caveats that I've closed everything.

    Sometimes, it's just my email that is open or a file folder, then there is no pending work.

    But I want to just close without the quiz on my understanding of the risks of loss of work, etc..

    I know that some applications such as Norton and Windows update can simply kill all ongoing enforcement programs to restart

    during the installation of updates, so the 'risk' is not worth the constant reading.

    Here are the steps to stop Windows 7 without using the mouse:

    Press Windows (Windows key).
    Release it
    Press the right arrow key
    Press ENTER key

    If you don't want warnings to stop, you can create a shortcut on the desktop with the command-line ' shutdown/f' and assign a key combination.

    See the following link for more shutdown command line options:
    http://www.computerperformance.co.UK/Windows7/windows7_shutdown_command.htm

    Once you create the shortcut icon on the desktop, you right-click on the icon, select Properties. In the shortcut tab, you can assign a key under the shortcut key combination to launch this program.

  • How to create new worksheet in excel without using report generation tools

    Hello

    Im trying to create a file with 8 spreadsheet excel. I am currently using scripture to the worksheet of the vi for that file. But how to create multiple worksheets in an excel file without using the report generation toolkit module of the OR?

    Concerning

    Jay

    Hello

    You can use the nodes property with the class selected as Activex Excel and create all the tools to Excel. See the attached example.

    Kind regards
    Constant

    (Bravo to give good answers, mark it as a Solution If your problem is resolved)

  • How to record what is happening by the sound card without using the microphone to avoid loss of quality.

    I tried, but there is no "Stereo mix" available options. There is only the (Conexant High Definition Audio) Microphone. It did not work. What I'll do is to buy a DVD for TV (tv Record program) burner and plug the hdmi cable from my computer to the DVD recorder and record what I want. After that, I just rip the audio from the file. I see no other option to do. I use windows vista Home premium.

    I would like to know how I can record the sound that is played by the soundcard using Vista without using the microphone as a source. Let's say the audio is played (audio stream) and I want to record this stream. There are many software that we can download that record what is happening in the microphone. The sound bounces off the speakers to the microphone. But when this happens, you lose a lot of the quality of the audio. So my question is if it is possible to record what is happening to the right of the sound card, before being sent to the sound card in order to avoid the loss of audio quality.

    ==============================
    Movie Maker has an option to record Narration...
    (Tools / tell the chronology). If you select stereo mix
    as the "Audio Input Source", you can save the
    Audio online. Your speakers and microphone are
    not required.

    And... maybe this link will help:

    How to record Internet radio stations on Windows Vista (using Audacity)
    http://www.ehow.com/how_4604071_record-Internet-radio-Windows-Vista.html John Inzer - MS - MVP - digital media experience

  • Can I connect my HP4625 all in one directly on my ipad/iphone without using a wifi network. ?

    Can I connect my HP4625 all in one directly on my ipad/iphone without using a wifi network. ?

    Hi xxtopgunxx,

    Welcome to the HP Support forums.  I understand you want to print from your devices Apple to your printer Deskjet Ink Advantage 4625 without the printer is connected to a wireless network.

    It is possible that we can get the printer to disseminate its own network. Please note that the network will broadcast the printer will not have access to the internet.  Please follow the steps below:

    • On the front panel of the printer, please press the wireless button
    • By using the buttons on the right, highlight and select wireless settings
    • Highlight and select Restore Defaults
    • Select Yes. A message appears indicating that the default values of the network have been restored
    • Open your application settings on your Apple device, please
    • Please click on wifi and choose the network that starts with "HP-SETUP.  This should connect to your Apple device to the printer
    • Now you should be able to print using the 'Action' icon.  If there is not a print option when you press the action icon following all guidelines for Apple AirPrint

    If you go to print and your Apple device does not see the network, you will need to follow the procedure again. It should be at least 60 minutes before the HP - Setup network ceased broadcasting.

  • Record without using the audio microphone

    I want to record from a file without using themicraphone on my laptop Inspiron 15 7537.  He had instlled software Realtek but no option to use the IDT internal microphone or Audio CODEC so he picks up background noise which is not good.  When I try to save the only option it is the Realtek microphone.

    Can someone season solution

    Thank you

    dlb21a
    He had instlled software Realtek but no option to use the IDT internal microphone

    Hello. As you say, your laptop has audio Realtek so it is unclear what you mean by "Microphone internal IDT. Dell doesn't use audio Realtek so IDT in the same model of laptop.

    Here are some other ways to save in addition to using the built-in microphone.

    > External mic. Because the Inspiron 7537 only has a headphone jack, you can't use a regular computer microphone which would have a TRS plug, but instead, you must use a headset with a plug from SOCKET that looks like this:

    "Headphones" is the headphones with a microphone. You can also use a regular mic which has a TRS plug if you get an adapter to convert it to a plug from SOCKET. The adapter is called a "helmet buddy."

    > A usb microphone.

    > If you want to record a stereo signal, you can do that through your headphone socket because its entry is mono only. To save the stereo, you need an adapter usb audio with a "line-in" socket Don't get one that has only a mic jack because it will be only mono too.

    dlb21a
    I want to record from a file

    > If the file is already in your computer, you can internally record in the computer by selecting 'stereo mix' as default device in the recording of the sound Properties tab. If you do not see the stereo mix, right-click in the empty area of the tab to open the context menu and select "Show disabled devices". (You must have your installed Realtek audio driver).

  • How can install a blackberry app without using "javaloader" of JDE. ???

    Hello

    We develop a blackberry using JDE application.

    Now, we try to run this application on real BlackBerry.

    We already know that we can use .cod file and download this .cod to a utility called «javaloader»

    located in bin of the JDE.

    But what happens when the user doesn't have a JDE install on their system.

    So how the user can download this application without using «javaloader»

    Thank you.

    Director of office of dowload.

    http://NA.BlackBerry.com/eng/support/software/desktop.jsp

    Connect your device to BB and PC via a USB port.

    Select the responsible Application of Option.

    Select your. ALX (can be created in your JDE-> project-> generate ALX file)

    Complete the Installation.

Maybe you are looking for