Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Calling all SQL Gurus ...
I am having a little trouble coming up with a nice little SQL statement
that does the following:
group on a column,
come up with a count of each occurence of the group,
sort descending on the count,
calculate the running percentage of the total count for each group,
and return the top N groups.
ex: suppose I have a table of EMPLOYEES, and I would like to select the first names which comprise the top 80% of all first names in the table.
Is this possible to do this as a single query?
TIA Pete Received on Sat Dec 12 1998 - 00:48:13 CST