Given a row in an example table as:
Column A |
---|
abcccaaaaddeeaabbaa |
How can we get the following output using MYSQL?
+———-+————-+
| sequence | occurrences |
+———-+————-+
| aaaa | 1 |
| ccc | 1 |
| dd | 1 |
| ee | 1 |
| aa | 2 |
| bb | 1 |
| a | 1 |
| b | 1 |
+———-+————-+
Tried to compute this using MySQL. Cannot get the right logic for the same.
sqlmnk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.