Skip to content
Advertisement

Oracle: how to get percent of total by a query?

I have the following query and its result is very unexpected to me:

it returns 100 for all rows. Should it be different ?

Advertisement

Answer

count(1) is equal to sum(1) in your case.

Try something like this:

update: or even simplier with ratio_to_report

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