title: Remove duplicates from cfquery based on a particular column
body: <p>I have got two cfquery result with same column name. I want to merge them in such a way that I remove the duplicates based on a particular colum.</p>
  
  <p>So it should be like merge query 1 with query 2 where value of query1.column1 > query2.column1</p>
  
  <p>Is there a way to get this done by MS SQL?</p>
  
  <p>My resulteset is like this at the moment</p>
  
  <pre><code>|name |value| temp_id
  test1   1     001
  test1   2         001
  test2   2         002
  test2   1         002
  </code></pre>
  
  <p>I want to get the rows with distinct column (name) and higest value</p>
  
  <p>So from above example I want </p>
  
  <p>test1 with value 2 and test 2 with value 2</p>