title: Reading data from one table and using it to read data from another table
body: <p>I'am trying to implement a small questionaire type of database in SQL Server 2008. The questions are multiple choice questions offerring four choices for each question. The questions reside in a Questions table. And the answer choices in another table called Answers. So, if there's a question in Questions with QuestionID=1, there'll be four tuples in Answers like:</p>
  
  <pre><code>QuestionId=1, AnswerID=a    
  QuestionId=1, AnswerID=b    
  QuestionId=1, AnswerID=c    
  QuestionId=1, AnswerID=d. 
  </code></pre>
  
  <p>I wish to write a single query that will return all the questions alongwith their respective answer-choices..One way is:</p>
  
  <pre><code>SELECT Q.Question, A.Answer   
  FROM Q.Questions  
  INNER JOIN A.Answers  
  ON Q.QuestionID = A.QuestionID
  </code></pre>
  
  <p>But this returns the same question 4 times; once with each answer choice..Is there a way to return it only once, followed by its four answer choices, that too without using any iterators or cursors?</p>
  
  <p>Thanks for your time :-)</p>