I have a table named student_info in my database.There are multiple columns out of which two columns store comma separated values
class_id student marks
----------------------------------------------
1 tom,jam,tim 55,65,75
2 rim,gum,ram 33,66,77
i want the output to be as follows
class_id student marks
------------------------------------------------
1 tom 55
1 tom 65
1 tom 75
1 jam 55
1 jam 65
1 jam 75
1 tim 55
1 tim 65
1 tim 75
my Query as below
SELECT student_id,TRIM(REGEXP_SUBSTR(student, '[^,]+', 1, level)) student_name
FROM STUDENT_INFO
CONNECT BY level <= REGEXP_COUNT(student, '[^,]+')
AND PRIOR student = student AND marks = marks
AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
with the above query i can get the output as below
class_id student_name marks
------------------------------
1 tom 55,65,75
1 jam 55,65,75
1 tim 55,65,75
How to achieve the desired output ?any suggestions?