I have a given data frame:
id | Number list |
---|---|
2 | [1,2,5,6,7] |
5 | [1,2,13,51,12] |
One of the columns is just the id and the other is a list of numbers like I got from the JSON file before, is there a way to convert it to this format using just MySQL?
id | Number list |
---|---|
2 | 1 |
2 | 2 |
2 | 5 |
2 | 6 |
2 | 7 |
5 | 1 |
5 | 2 |
5 | 13 |
5 | 51 |
5 | 12 |
I know it can be done easily using Python and pandas, but in this case I just need to use MySQL, and I don't really know how to transpose a list in MySQL
@Ruslan Pylypiuk
Postgresql Soul:
Mysql Soul: ReferenceSQL split value into multiple rows
You can use json_table()