title: writing a query using advanced group by
body: <p>I have a single table database consists of the following fields:
  ID, Seniority (years), outcome and some other less important fields.
  Table row example:</p>
  
  <pre><code>ID:36     Seniority(years):1.79   outcome:9627
  </code></pre>
  
  <p>I need to write a query (sql server) in relatively simple code that returns the average outcome, grouped by the Seniority field, with leaps of five years (0-5 years, 6-10 etc...) with the condition that the average will be shown only if the group has more than 3 rows.</p>
  
  <p>Result row example:</p>
  
  <pre><code>range:0-5    average:xxxx
  </code></pre>
  
  <p>Thank you very much</p>