I have a table with below contents :
SQL> select RULE_IDS ||' | '|| ID ||' | '|| ALERT_COUNT from alarms ;
RULE_IDS||'|'||ID||'|'||ALERT_COUNT
--------------------------------------------------------------------------------
3714,3715,3703 | 1031 | 3
3703,3714,3722,3721 | 1032 | 4
3715 | 1033 | 1
3721,3722 | 1034 | 2
3714,3715 | 1035 | 2
3706 | 1030 | 1
3723,3714 | 1036 | 2
3703 | 1025 | 1`
My requirement is to find the count of each RULE_IDS (the comma separated values). e.g. the output should be like this :
SQL> select RULE_IDS ||' | '|| ID ||' | '|| ALERT_COUNT from alarms ;
RULE_IDS||'|'||COUNT
--------------------------------------------------------------------------------
3714 | 4
3715 | 3
3703 | 3
3721 | 2
3722 | 2
3723 | 1
3706 | 1
How can I achive that. Please help me out. Thanks in advance.
Regards