SELECT * from sys.databases where name = \'quizapplication\' GO SELECT submittedanswer.sa, answer.ans; FROM answer INNER JOIN ( SELECT TOP 1 sa FROM submitted