When I run the following code
select u.user_id
,u.first_name
,u.last_name
,u.email_address
,u.zip_code
,u.birthdate
,u.gender
,qr.answer
,qr.question_id
from fancompass_acurve.users u
left join fancompass_acurve.question_responses qr
on u.user_id = qr.user_id
For the qr.answer I get results like [“1″,”2″,”3″,”4”],[“3″,”4”],[“1″,”4”]. I want to split it so I have row for each answer.
I have tried different functions like jsonb_array_elements_text or CROSS APPLY to no success, and I am not sure if it is because my version of PostgreSQL or not.
New contributor
CoolBeans87 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.