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

Home -> Community -> Usenet -> c.d.o.server -> Re: Group by: Not getting expected output

Re: Group by: Not getting expected output

From: Vince <vinnyop_at_yahoo.com>
Date: 10 May 2006 09:43:00 -0700
Message-ID: <1147279380.110009.200510@j33g2000cwa.googlegroups.com>


Try this:

SELECT tcode,

       SUM( CASE
                WHEN tavg >= 2 AND tavg < 3 THEN 1
                ELSE                             0
            END
          )  AS GradeEq2to3

FROM info
GROUP BY tcode
ORDER BY tcode; Received on Wed May 10 2006 - 11:43:00 CDT

Original text of this message

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