Currently I have in my DB(mariaDB) a column that is called data and contains a json list:
ID | data
1 | '["section1","section2","section3"]'
2 | '["section2","section4"]'
I would like to turn it into something like that:
id | section1 | section2 | section3 | section4
1 | 1 | 1 | 1 | 0
2 | 0 | 1 | 0 | 1
Meaning that all possible values from all fields become columns and get the value 1 if that list item exists for the row accordingly and 0 if it does not.
Is there any way to transform this with a query?