Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

query to return count for values separated by commas in single column

User_O5P4XJul 5 2016 — edited Jul 5 2016

Hi Experts,

I would like to retrieve count of the values separated by comma using regexp_substr but i get more values than expected

COUNT(*)  TAGS

           1     MCS, MAX, MOB

           1     MCS

           1     Web, Multi, Workshop

           2     Web

select distinct count(*), taggs from (select regexp_substr(tags,'[^,]+', 1, level )taggs from XXRequests

connect by regexp_substr(tags, '[^,]+', 1, level) is not null) group by taggs;

This is happening since i receive more rows in single select. Can you please let me know how to correct this.

Thanks,

Vinodh

This post has been answered by BluShadow on Jul 5 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2016
Added on Jul 5 2016
10 comments
2,658 views