Get Column value count
BagiyaMay 14 2008 — edited May 15 2008Hi All,
this is a my test table stucture.
create table testtab
(
emp_id number (10),
day_01 varchar2 (1),
day_02 varchar2 (1),
day_03 varchar2 (1),
day_04 varchar2 (1));
I'm having data stord as follows
SELECT * FROM TESTTAB;
EMP_ID DAY_01 DAY_02 DAY_03 DAY_04
------- ------- ------- ------- -------
68962 A D A A
68965 D D D A
68962 A A A A
68965 D D A A
I wanted to get a output as follows.
Note: - Day_01 to Day_05 values may vary. Not always A and D. some time user may add some other character also. Count should be calculated dynamically
EMP_ID A-Count D -Count
-------- --------- --------
68962 7 1
68965 3 5
Thanking You