How to return multi- value columns in sql which is group by another column. I have a table that contain question_id and competency_id.what i want is to return all the question_id as a single column based on competency id.
c_id = [1,2,1,2,3,1];
q_id=[20,21,23,26,24,25];
what i want
expected = [{c_id:1,q_id:[20,23,25]},{c_id:2,q_id:[21,26]},{c_id:3,q_id:[21,26]}];
what i tried
select c_id, q_id from table group by c_id;