[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 958
  • Last Modified:

Error ora-00935 ?

I have a problem with my SQL,

here it is....

SELECT COUNT(DECODE(IDTRIAGE,'N1','N1'),
 COUNT(DECODE(IDTRIAGE,'N2','N2'),
 COUNT(DECODE(IDTRIAGE,'N3','N3'),
 COUNT(DECODE(IDTRIAGE,'N4','N4'),
 COUNT(DECODE(IDTRIAGE,'N5','N5')
 FROM TBLVISITE WHERE IDHOPITAL = 'H1';

when I run it....it gives me this error

ORA-00935: group function is nested too deeply

why ?
0
Peewee20
Asked:
Peewee20
1 Solution
 
renurajCommented:
SELECT COUNT(DECODE(IDTRIAGE,'N1','N1')),
COUNT(DECODE(IDTRIAGE,'N2','N2')),
COUNT(DECODE(IDTRIAGE,'N3','N3')),
COUNT(DECODE(IDTRIAGE,'N4','N4')),
COUNT(DECODE(IDTRIAGE,'N5','N5'))
FROM TBLVISITE WHERE IDHOPITAL = 'H1'

Is it the one u'r expecting.  If not please specify what output u want to get.
You have missed right paranthesis on no of ocassions.

Regards,
0
 
rmyufaCommented:
Hi!

ORA-00935 group function is nested too deeply

       Cause: This is an internal error message not usually issued.

        Action: Contact Oracle Customer Support.

This is from ORA Errors Book!

Regards,
pm
0
 
konektorCommented:
do u want to count how much rows are in TBLVISITE
where IDHOPITAL = 'H1' and IDTRIAGE = 'N1'
where IDHOPITAL = 'H1' and IDTRIAGE = 'N2'
... ?

do :
select
  sum(decode(IDTRIAGE,'N1',1,0)),
  sum(decode(IDTRIAGE,'N2',1,0)),
  ...
from TBLVISITE
where IDHOPITAL = 'H1'
m.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now