i have a questions database of the shape
ID , Question , Answer1 , Answer2 , Answer3 , Answer4 , True
where “True” is the index of the correct answer:
True = 0 --> Answer1
....
True = 3 --> Answer4
i need to select only the question and the correct answer, this is what i got so far:
SELECT Question , 'Answer' || (True+1) From Questions
but it returns the question and ‘answer1’ or ‘answer2’ … ie: the name of the column i need not it’s value
you can use
CASEin MySQL.OR