Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help newbie with SQL code
> What is wrong with this statement
>
> SELECT hiredate,
> DECODE (hiredate,(hiredate<01-jan-81),count(hiredate),hiredate)
> from emp;
>
The arguments of DECODE can't be logical
> output should look like this
>
> TOTAL 1980 1981 1982 1983
> -------- ----- ----- ------ -----
> 14 1 10 2 1
>
this output is complex to make,
best of all use like statment:
SELECT to_char(hiredate, 'YYYY'), count(*)
FROM emp
GROUP BY to_char(hiredate, 'YYYY')
ORDER BY 1
Received on Fri Mar 16 2001 - 04:30:09 CST