1

I have a column in SQL which is a comma separated list (1,2,5,4). How can I count the values in that list?

Example:

id           info
-------------------------------
1            1,2,5
2            2
3        
4            78,5 
5            14,25,1,2

The result should look like this:

id           count(info)
----------------------------------
1            3
2            1
3            0
4            2
5            4

How can I create this table in MySQL?

msrd0
  • 7,002
  • 9
  • 41
  • 74
HunTer AnDone
  • 122
  • 10

0 Answers0