title: Need a Query to fetch distinct data from a table in my sql
body: <p>I have a table History which contains below columns:</p>
  
  <pre><code>ID   Previous  Current  User     createdOn
  1    RED       BLUE     System   2020-04-14 09:24:49.765000
  2    GREEN     YELLOW   ADMIN    2020-04-12 03:56:34.765000
  3    GREEN     BLUE     System   2020-04-14 11:37:21.765000
  4    ORANGE    RED      System   2020-04-15 11:24:49.765000
  </code></pre>
  
  <p>I need a query to fetch data from a table in a manner that every user should return only one row for the day even if a user has more than one entry for a day</p>
  
  <p>The required resultset should be as below : </p>
  
  <pre><code>User       CreatedOn
  ADMIN      2020-04-12 03:56:34.765000
  System     2020-04-14 09:24:49.765000
  System     2020-04-15 11:24:49.765000
  </code></pre>