title: Ignoring rows within daterange
body: <p>I have the following data:</p>
  
  <pre><code>CREATE TABLE SampleData
  (
      orderid int,
      [name] nvarchar(1),
      [date] date
  );
  INSERT INTO SampleData
  VALUES
  (1, 'a', '2017-01-01'),
  (2, 'a', '2017-01-05'),
  (3, 'a', '2017-02-01'),
  (4, 'a', '2017-04-01'),
  (5, 'a', '2017-10-01'),
  (6, 'b', '2017-04-01');
  </code></pre>
  
  <p>I need to retrieve each new order according to the following rules:</p>
  
  <ul>
  <li>The first date for a name is the 'current order' for that name</li>
  <li>Orders with the same name, but less than 3 months difference with the 'current order' is considered the same order and needs to be ignored</li>
  <li>3 months or more difference with the 'current' order is considered a new order and is now the 'current order' (in the SampleData orderid 1 and 4 need to be compared instead of 3 and 4, because 3 is not the current order)</li>
  <li>If the name and date are the same, then the row with the lowest orderid is the superior order </li>
  </ul>
  
  <p>So with the sample data I need the following result:</p>
  
  <pre><code>id name, date
  1  a     2017-01-01
  4  a     2017-04-01
  5  a     2017-10-01
  6  b     2017-04-01
  </code></pre>
  
  <p>I tried several approaches, but without success. Any idea's on how I can achieve this?</p>