I have a legacy table with unnormalized column evaluation
that has values like 8, 5, 9
or 7, 6
. How do I explode these string by comma and sum the value using SQL?
assignments table:
id | evaluation
---|------------
1 | 7,6,8
2 | 3,2
desired result:
id | score
---|------------
1 | 21
2 | 5