title: How To get the First Row Form SQL Group Query?
body: <p>I have a problem in writing a query.</p>
  
  <p>I'd like to select the first row of each set of rows grouped   </p>
  
  <p>My table is <code>Transactions</code>:</p>
  
  <pre><code>userID | Date     | StoreID 
  ---------------------------
       1 | 8-9-2013 | 10
       1 | 9-9-2013 | 10
       1 | 10-9-2013| 20
       2 | 7-9-2013 | 30
       2 | 8-9-2013 | 10
       2 | 9-9-2013 | 20
       1 | 11-9-2013| 10
       2 | 10-9-2013| 20
  </code></pre>
  
  <p>and I try to this SQL statement:</p>
  
  <pre><code>Select 
      tr.userID , Min(tr.TransactionDate) FirstDate
  From 
      Transactions tr 
  Group By 
      tr.userID 
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>userID | Date     
  ------------------
       1 | 8-9-2013 
       2 | 7-9-2013
  </code></pre>
  
  <p>But I need the <code>Store ID</code> in every first transaction.</p>
  
  <p>I need it to be like that </p>
  
  <pre><code> userID | Date    |  StoreID
  -------------------------
       1 | 8-9-2013 |  10
       2 | 7-9-2013 |  30
  </code></pre>
  
  <p>Please any one can help me </p>