PL/SQL (MOSC)

MOSC Banner

Report - Percentage

edited Aug 28, 2012 6:37AM in PL/SQL (MOSC) 3 commentsAnswered
Hello!

              I have a table with this structure and content:

           COD     AMOUNT    MARK

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

               1            10              2

               1            10              3

               2            10              2

               1            10               2

              I would like to produce a report with this layout:

          COD      TOTAL     TOTAL2       % TOTAL2/TOTAL

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

               1       30              20                           66,67%

               2       10               10                         100,00%

where:

COD - code

TOTAL - sum of column AMOUNT of certain code

TOTAL2 - sum of column AMOUNT of certain code and column MARK = 2

TOTAL2/TOTAL - percentage of TOTAL2 and TOTAL

How can I do this?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center