title: GROUP BY each 6 months in one record
body: <p>I am having trouble retrieving certain data from a db through a SELECT query as such:</p>
  
  <pre><code>SELECT table.something
  FROM table
  WHERE table.date BETWEEN 'from' AND 'to'
  GROUP BY (each 6 months between the from and to date).
  </code></pre>
  
  <p>Any idea how this can be done without having to recur to a view and an external grouping through code.</p>