Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help: SELECT statement
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