Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: More SQL counting questions...
"Mark D Powell" <Mark.Powell_at_eds.com> wrote in message
news:1123256162.846883.118530_at_g49g2000cwa.googlegroups.com...
> This may not be the slickest solution but it works for the test data
> given. I just broke the problem into queries for part of the data and
> (outer) joined them. If there are more than 2 types of messages you
> will probably need to modify the solution since I derived the major
> error count as total count minus critical. But writing the query to
> sum 0 or 1 for critical and major in one query is easy with
> case/decode.
Just to complicate things, there are actually 6 'severity levels':
decode(act.severity,
1,'UNKNOWN', 2,'NORMAL', 4,'WARNING', 8,'CRITICAL', 16,'MINOR', 32,'MAJOR')
Thanks for offering some help. I'm going to keep on trying to find a 'pretty' solution.
Marco Received on Fri Aug 05 2005 - 11:25:51 CDT