Skip to content
Advertisement

sum on having count more than 1

Currently I execute below code

I get below data ”’ enter image description here

I want to insert a difference field, which is calculated as [(namount for system a) – (namount for system z) ]. namount for system z is calculated as (total namount for buys – total namounts for sells).

please help me get a sql to achieve this, thanks very much and I sincerely appreciate your help.

Advertisement

Answer

calculated as [(namount for system a) – (namount for system z) ]

If this is what you want, you can use window functions:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement