title: T-SQL find rows with dates in correct order
body: <p>I want to somehow mark the rows for each Class-number in the example below that have a row with the same date or rows with dates in order of each other. Have tried to accomplish this way to long but really have nothing of value to share with you...</p>
  <p>Having the following sample data:</p>
  <pre><code>Date                      Class
  2016-10-17 00:00:00.000   1
  2016-10-20 00:00:00.000   1
  2016-10-18 00:00:00.000   1
  2016-10-25 00:00:00.000   1
  2016-10-19 00:00:00.000   2
  2016-10-19 00:00:00.000   2
  2016-10-28 00:00:00.000   2
  2016-10-25 00:00:00.000   3 
  </code></pre>
  <p>With the logic above, it should produce:</p>
  <p><a href="https://i.stack.imgur.com/18xdi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/18xdi.png" alt="enter image description here" /></a></p>