Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> DECODE
Hi,
in the statement :
select
DECODE (deptno,10, 'ACCOUNTING', 20, 'RESEARCH', 30, 'OPERATION', 40, 'OPERATION', 'NONE')count(*) from tableA
is there anyway for me to group by the decoded values rather than
the original stored values ?
eg i have 2 diff dept numbers, but i want to group them as 1 dept,
using the above statement, there will be 2 rows of OPERATION.
col alias cannot be used in the group by.
Thanks
Boon Yiang
Received on Thu Feb 03 2000 - 23:30:09 CST