title: How to group by less columns than selected
body: <p>I'm facing a problem here (using SQL Server 2005).</p>
  
  <p>My <code>SELECT</code> query looks like this:</p>
  
  <pre><code>SELECT 
  a.str_column1, b.str_column2, c.date_column3, c.guid_column4
  FROM table
  ....
  joining the other tables here to get my columns
  ....
  GROUP BY 
      a.str_column1, b.str_column2, c.date_column3, c.guid_column4
  </code></pre>
  
  <p>This will give something like this</p>
  
  <pre><code>a.str_column1    b.str_column2    c.date_column3    c.guid_column4
  ------------------------------------------------------------------
  a1               b1                15/07/2013       someID    
  a2               b2                05/06/2012       someID
  a1               b1                07/08/2013       someID
  ....
  </code></pre>
  
  <p>Now I want so that it's grouped by <code>a.str_column1</code> and <code>b.str_column2</code>, only getting the most recent one (<code>order by c.dat_column3</code>)</p>
  
  <pre><code>a.str_column1    b.str_column2    c.date_column3    c.guid_column4
  ------------------------------------------------------------------
  a1               b1                07/08/2013       someID
  a2               b2                05/06/2012       someID
  </code></pre>
  
  <p>Any idea how I can accomplish this with SQL?</p>