0

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.

1 Answers1

1

One method uses the difference of lengths of strings:

select ( character_length(text_column) - character_length(oreplace(text_column, ',', '')) as num_columns
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786