Dear Oraclegroupers,
How would you solve the following problem in pure sql?
I want to count the records in a table, grouped by one
attribute. So I get a list like:
1 10
2 150
3 30
4 10
Now I want the same list, but not the counts, but as
percentages, like:
1 5.0
2 75.0
3 15.0
4 5.0
I know of solutions with help of views (but I once heard
that anything you can do with views, can be done in one
SQL-statement. Does somebody know any prove of this?),
or with use of variables in SQL*Plus, but that is not
what I am searching for.
Any ideas?
Gert de Boer
deboer_at_wsl.ethz.ch