title: SQL: How to select first record per day, assuming that each day contains more than 1 value
body: <p>I am trying to write a SQL query where the results would show the first value (ID) per user per day for the last year.</p>
  <p>I tried using the query below and am able to get results for one day but when I try to change the time range to &gt; 2021-06-01, it does not give me the results I expect.</p>
  <p>select * from table
  where value in
  (
  SELECT min(value)
  FROM table
  WHERE valueid = x</p>
  <pre><code>group by user
  </code></pre>
  <p>) and Time = '2022-05-30' and value is not null</p>