I have this SQL:
SELECT sets.set_id, responses.Question_Id, replies.reply_text, responses.Response
FROM response_sets AS sets
INNER JOIN responses AS responses ON sets.set_id = responses.set_id
INNER JOIN replies AS replies ON replies.reply_id = responses.reply_id
WHERE sets.Sctn_Id_Code IN ('668283', '664524')
A partial result:
I want to replace the reply_text
and response columns with one column that will have the value of the response if it isn't null and the reply text value otherwise. I'm not sure if this can be done with a case statement, at least nothing I've dug up leads me to think that I can. Am I incorrect in assuming this?