How to count unique elements of a string in Redshift? (Currently trying with regex)
I’m trying to count the number of unique elements in a list (with delimiter “,”) in Redshift. I’ve looked into using REGEXP_COUNT with PCRE patterns for regex. Testing with the below list (“list,test,test,count”), I’d like to get 3 (list, test, count) but it’s resulting in 0.
count unique elements of a string with regex and delimiter “,”
I’m trying to count the number of unique elements in a list (delimiter “,”) in Redshift. I’m currently using REGEXP_COUNT with PCRE patterns for regex. Testing with the below list (“list,test,test,count”), I’d like to get 3 (list, test, count) but it’s resulting in 0.