sql - I want to count the number of occurences of a value in a string -


given column namely a result of array_to_string(array(some_column)), how count occurrence of value it?

say have '1,2,3,3,4,5,6,3' value of column.
how number of occurrences value '3'?

i solved myself. thank ideas!

select count(something) unnest(         string_to_array(             '1,2,3,3,4,5,6,3'         , ',')     ) something = '3'