title: Delete duplicates MS-SQL with minimum date and multiple keys
body: <p>I have a big table that has duplicates as such:</p>
  
  <ul>
  <li><code>number</code> (primary key), </li>
  <li><code>group</code> (primary key), </li>
  <li><code>Division</code> (primary key), </li>
  <li><code>dateChange</code>.</li>
  </ul>
  
  <p>Example:</p>
  
  <pre><code>1,2,3,20121015
  
  1,2,3,20120101
  
  1,2,3,20110101
  
  2,2,2,20121010
  
  2,2,2,20120101
  </code></pre>
  
  <p>result should be:</p>
  
  <pre><code>1,2,3,20121015
  
  2,2,2,20121010
  </code></pre>
  
  <p>I have tried many combinations including group by the primary key with minimum "changeDate"
  but nothing seems to work perfectly. </p>
  
  <p>I want to have something like this:</p>
  
  <pre><code>delete from table where (number,group.devision,changeDate) not in 
  (select from table(number,group,devision,Max(changeDate)) 
  group by (number,group.devision)
  </code></pre>
  
  <p>But I dont think it is a valid MS-SQL syntax.</p>
  
  <p>Your help will be very appreciated!! </p>