title: postgres: How to select that have every value in a range?
body: <p>I have a table, <code>test_table</code> that looks like this:</p>
  
  <pre><code>     analysis_date      |      test_num
  ------------------------+--------------------
   2001-01-01             |                  1
   2001-01-01             |                  2
   2001-01-01             |                  3
   2001-01-02             |                  1
   2001-01-02             |                  2
   2001-01-02             |                  3
   2001-01-03             |                  1
   2001-01-03             |                  2
   2001-01-03             |                  8
  </code></pre>
  
  <p>I only want to select rows in which the analysis date has a value for <code>test_num</code> 1, 2, AND 3. The query should not return rows for anlysis_date <code>2001-01-03</code>as row for <code>test_num</code> = 3 is missing</p>
  
  <pre><code>     analysis_date      |      test_num
  ------------------------+--------------------
   2001-01-01             |                  1
   2001-01-01             |                  2
   2001-01-01             |                  3
   2001-01-02             |                  1
   2001-01-02             |                  2
   2001-01-02             |                  3
  </code></pre>
  
  <p>I am aware of the <code>BETWEEN</code> query, but that doesn't guarantee that all the values within the range exist.</p>