title: Select entries where Date Difference not higher than 5 days
body: <p>I am looking for a SQL Statement which gives me all Entries whoms Date are not more than 5 days apart from another entry in this Table.</p>
  
  <p>Example:</p>
  
  <pre><code>ID | Date
  
  1  | 16.10.14 00:00:00
  2  | 14.10.14 00:00:00
  3  | 09.09.14 00:00:00
  4  | 13.10.14 00:00:00
  5  | 06.07.14 00:00:00
  6  | 09.01.14 00:00:00
  7  | 10.01.14 00:00:00
  8  | 14.05.14 00:00:00
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>ID | Date
  
  1  | 16.10.14 00:00:00
  2  | 14.10.14 00:00:00 
  4  | 13.10.14 00:00:00
  6  | 09.01.14 00:00:00
  7  | 10.01.14 00:00:00
  8  | 14.01.14 00:00:00
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>In fact all I need is a way to do a diff over the datatype <code>Date</code>. That's why I cant even show my attempts cause I'm missing the keyword.</p>
  
  <p>Nevermind I will still try</p>
  
  <p>It should be something like this:</p>
  
  <pre><code>select * from example m where m.Date  not more apart than 5 days from another entry in the Table 
  </code></pre>