I have a table in Teradata. This table has a column named text_column that contains some text in format varchar(25).
I need to count the number of ',' in this column.
I have a table in Teradata. This table has a column named text_column that contains some text in format varchar(25).
I need to count the number of ',' in this column.
One method uses the difference of lengths of strings:
select ( character_length(text_column) - character_length(oreplace(text_column, ',', '')) as num_columns