Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: More SQL counting questions...

Re: More SQL counting questions...

From: Marco Shaw <marco_at_Znbnet.nb.ca>
Date: Fri, 05 Aug 2005 16:25:51 GMT
Message-ID: <jqMIe.70488$Ph4.2193238@ursa-nb00s0.nbnet.nb.ca>

"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US