I created a database for problem set with 6 column(problemId
, a
,b
,c
,d
, rightAnswer
), where a
,b
,c
,d
stores the details of each option and rightAnswer
stores the index of right answer such as a, b, c, d.
Now I want to extract the index of right answer in rightAnswer
(for example, a )and then select a from the table.
Here is my code:
SELECT (SELECT rightAnswer FROM table WHERE problemId=1) FROM table WHERE problemId=1
But it didn't work.