title: Return all columns with distinct on multiple columns in SQL table
body: <p>I have 5 columns in sql table and I need all the 5 columns as out put but with distinct operation on three columns</p>
  
  <p>Need to return all the columns with distinct operation on three column</p>
  
  <p>How to achive this?</p>
  
  <pre><code>Timestamp                   Name    State     Context
  2013-06-24 11:51:03.2550000 tst1    Started     E1
  2013-06-24 11:56:03.2550000 tst1    Completed   E1
  2013-06-24 11:51:03.2550000 tst1    Started     E1
  2013-06-24 11:56:03.2550000 tst1    Completed   E1
  2013-06-24 11:45:03.2550000 tst1    Started     E1
  2013-06-24 11:50:03.2550000 tst1    Completed   E1
  2013-06-24 11:45:03.2550000 tst1    Started     E1
  2013-06-24 11:50:03.2550000 tst1    Completed   E1
  </code></pre>
  
  <p>Here I am getting all the distinct result for above table by applying distinct on three columns using below query. But I need the distinct of these three columns also need to select context column without applying distict on Context column</p>
  
  <blockquote>
    <p>SELECT DISTINCT Timestamp,Name,State   FROM TableName group by 
    Timestamp,Name,State</p>
  </blockquote>
  
  <p>Rephrasing my question : </p>
  
  <p>I need to select unique columns from above table . Here only unquie column selection considered as Timestamp,Name,State</p>
  
  <pre><code>Timestamp                   Name    State     Context
  2013-06-24 11:51:03.2550000 tst1    Started     E1
  2013-06-24 11:56:03.2550000 tst1    Completed   E1
  2013-06-24 11:45:03.2550000 tst1    Started E1
  2013-06-24 11:50:03.2550000 tst1    Completed   E1
  </code></pre>