title: Getting results between two dates in PostgreSQL
body: <p>I have the following table:</p>
  
  <pre><code>+-----------+-----------+------------+----------+
  | id        | user_id   | start_date | end_date |
  | (integer) | (integer) | (date)     | (date)   |
  +-----------+-----------+------------+----------+
  </code></pre>
  
  <p>Fields <code>start_date</code> and <code>end_date</code> are holding date values like <code>YYYY-MM-DD</code>. </p>
  
  <p>An entry from this table can look like this: <code>(1, 120, 2012-04-09, 2012-04-13)</code>.</p>
  
  <p>I have to write a query that can fetch all the results matching a certain period. </p>
  
  <p>The problem is that if I want to fetch results from <code>2012-01-01</code> to <code>2012-04-12</code>, I get 0 results even though there is an entry with <code>start_date = "2012-04-09"</code> and <code>end_date = "2012-04-13"</code>.</p>