title: how to select min value from table if table has two unique values with rest of columns are identical
body: <p>ex:Input</p>
  
  <pre><code>ID   Col1   Col2   Col3
  --   ----   ----   ----
  1       a     a     sql  
  2       a     a    hive
  </code></pre>
  
  <p>Out put</p>
  
  <pre><code>ID   Col1   Col2   Col3
  --   ----   ----   ----
  1       a     a     sql  
  </code></pre>
  
  <p>Here my id value and Col3 values are unique but i need to filter on min id and populate all records.</p>
  
  <p>I know below approach will work, but any best approach other than this please suggest </p>
  
  <p>select Col1,Col2,min(ID) from table group by Col1,Col2;</p>
  
  <p>and join this on ID,Col1,Col2</p>