|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
OK I am tring to create a query and I am not sure how to do it.
example query: 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 FOr the life of me I just cant figure this out. ANd I know that it is going to be a really simple answer. Thank you for any help you can offer |
|
#2
|
||||
|
||||
|
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
|
|
#4
|
|||
|
|||
|
OK that worked for oracle 9i but when I try in
SQL*Plus: Release 8.1.6.0.0 - Production I get the following error SQL> select fcr, count(fcr), (count(fcr)/(select count(fcr) from incident))*100 "%" from nx_winch_case_details group by fcr; select fcr, count(fcr), (count(fcr)/(select count(fcr) from incident))*100 "%" from nx_winch_case_details group by fcr * ERROR at line 1: ORA-00979: not a GROUP BY expression where the * is under the count(fcr) from the nested select statement. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Need SQL Query Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|