title: SQL Server display messages like a conversation
body: <p>I'm developing a information system, and I've and message center. And I want to display the messages like Outlook or Gmail "conversation".</p>
  
  <p>In my message table I have the following columns:</p>
  
  <ul>
  <li>MessageId (PK)</li>
  <li>Date</li>
  <li>From (FK)</li>
  <li>To (FK)</li>
  <li>Body</li>
  <li>Subject</li>
  <li>State</li>
  <li>Subject</li>
  <li>ReplyId (FK), null</li>
  </ul>
  
  <p>First I get the messages that don't have <code>replyId</code>, to show the "latest" message.</p>
  
  <p>But I don't get the conversation, when any one click on message... :( </p>
  
  <p>Any one could help me with the query? </p>
  
  <p>Thanks in advance</p>
  
  <p>EDIT:
  I add an extra field to the table, the Id of last reply to the conversation, so I can get all conversation message at one time!</p>
  
  <p>:)</p>