I have a SQL Table like this:
TABLE 1(ANSWERS)
| ID | CODE_STUDENT| ANSWERS
+----------------+-------------+-------------------
| 1 | 1 | 1,2,4
| 2 | 2 | 3,2,3
TABLE 2(STUDENT)
| ID | NAME | GENDER
+----------------+-------------+-------------------
| 1 | ANDY | MAN
| 2 | MARRY | WOMAN
how do I get the select query results like this
| STUDENT.ID | STUDENT.NAME| QUESTION | ANSWERS.ANSWERS
+----------------+-------------+-------------------+-------------------
| 1 | ANDY | 1 | 1
| 1 | ANDY | 2 | 2
| 1 | ANDY | 3 | 4
| 2 | MARRY | 1 | 3
| 2 | MARRY | 2 | 2
| 2 | MARRY | 3 | 3
Basically split my data at the comma into individual rows and join two table?
the question values, can be obtained by counting the number of indexes of the answers