I have the following database table:
Answer
MemberID | QuestionNo | AnswerNo | AnswerString
10 | 1 | 2 | q1 anwer2
10 | 2.1 | 3 | q2.1 answer3
10 | 2.2 | 5 | q2.2 answer5
10 | 7 | 1 | q7 answer 7
11 | 1 | 3 | q1 anwer 3
11 | 3 | 1 | q3 answer 1
11 | 5 | 4 | q5 anwer 4
Each member answers different set of questions based on the answers of previous questions. I want to show the answer in the following format
MemberID | 1 | 2.1 | 2.2 | 3 | 5 | 7
10 | 2 | 3 | 5 |NULL |NULL| 1
11 | 3 |NULL |NULL | 1 | 4 |NULL
Can I do it only in SQL Server 2005? Or I need to use ASP.net to process it?