dynamic column selection based on cell value

attila

New Member
i have a questions database of the shape\[code\]ID , Question , Answer1 , Answer2 , Answer3 , Answer4 , True\[/code\]where "True" is the index of the correct answer:\[code\]True = 0 --> Answer1....True = 3 --> Answer4\[/code\]i need to select only the question and the correct answer, this is what i got so far:\[code\]SELECT Question , 'Answer' || (True+1) From Questions\[/code\]but it returns the question and 'answer1' or 'answer2' ... ie: the name of the column i need not it's value
 
Back
Top