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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Help: SELECT statement

Re: Help: SELECT statement

From: Galen Boyer <galenboyer_at_yahoo.com>
Date: 2 May 2001 13:30:09 -0500
Message-ID: <ug0enk3l2.fsf@primix.com>

On 2 May 2001, macflores_at_northwestern.edu wrote:

> I would like a SELECT statement which will count how many 'Y'
> each employee has. If there is no 'Y' then the employee gets a
> count of '0' as shown in the table VIEW below:

SELECT Emp, sum(decode (status,'Y',1,0)) FROM test
group by EMP;

-- 
I don't want to be the rock.  Yeah, okay, what do you want to be?
I want to be the piece of glass.
Received on Wed May 02 2001 - 13:30:09 CDT

Original text of this message

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