0

I have the following table.


id | value

1 | A B,B C

2 | C D,A B

3 | B C,A E


I want to know count of substring.


sub | count

A B | 2

B C | 2

C D | 1

A E | 1


How do I get this result by using sql query in Mysql?

LeeJaeng
  • 21
  • 4
  • Do you have a reference table with distinct values? – shmosel Jan 02 '17 at 05:21
  • 1
    Possible duplicate of [Count occurrences of a sub string in a MySQL column](http://stackoverflow.com/questions/12736459/count-occurrences-of-a-sub-string-in-a-mysql-column) – Gaurav Agrawal Jan 02 '17 at 05:27

0 Answers0