How to count the number of comma-separated items in MySQL?

1

I have a field in a table with data separated by a comma: condicao_pagamento: 20,25,35,45,50 .

How do I count the number of comma-separated items using MySQL only?

    
asked by anonymous 06.07.2015 / 06:13

1 answer

0

Check if this is what you want:

LENGTH(fooCommaDelimColumn) - LENGTH(REPLACE(fooCommaDelimColumn, ',', ''))

link

    
06.07.2015 / 09:51