I have a table which contain value like this
+-------+-----------+------------+------------+-----------+
| User | activity1 | activity2 | activity3 | activity4 |
+-------+-----------+------------+------------+-----------+
| user1 | A.C.E A1 | A.... | ABCDE ZZZ | A.C.. |
| user2 | A.C.. | A.CD. | ABCDE text | ABCD. |
| user3 | ABC.. | A.C.E free | A.... | A.... |
+-------+-----------+------------+------------+-----------+
I want result something like
+-------+---+---+---+---+
| User | A | B | C | D |
+-------+---+---+---+---+
| user1 | 4 | 1 | 3 | 1 |
| user2 | 4 | 2 | 4 | 3 |
| user3 | 4 | 1 | 2 | 0 |
+-------+---+---+---+---+
Result of A B C and D are summary of present of each text in columns activity1..4 for each row.
I try with SUM(CASE WHEN which I must do something wrong and it give me wrong count. I can not get count result more than 1.
Text after E would be free text what ever can be possible and don't care at the moment.
This data was original in csv format export from some other system which I can have to get it this way then import to mysql server.
I am not expert in sql. Could someone help to find solution for query.