OK when trying to run the following query on oracle 8i I get an error. However when running on 9i it works fine. Unfortunately I have to get this to work on 8i for work.
example query:
Code:
select fcr, count(fcr) from incidents group by fcr;
FCR COUNT(FCR)
--- ----------
N/A 3466
No 8844
Yes 111968
Now what I want is this
FCR COUNT(FCR) % of total
--- ---------- -------------
N/A 3466 0.02
No 8844 0.07
Yes 111968 .91
which should be possible with this query
Code:
SELECT fcr,
(count(fcr)/(SELECT count(fcr) FROM incidents))
FROM incidents
GROUP BY fcr;
But when running on oracle 8i I get the following error
ORA-00979: not a GROUP BY expression
and SQL*Plus shows the * under the count(fcr) within the nested select.
Any Ideas how else this could be done or a way to not recieve this error?