Count the number of times a date is contained between 2 date columns
<p>I have a table that looks like this </p>

<pre><code>ID  start_dt    end_dt
--------------------------
1   1951-12-05  1951-12-21
2   1951-12-19  1951-12-31
3   1957-12-05  1957-12-19
4   1995-12-06  1995-12-20
5   1996-06-24  1996-07-08
6   1997-05-12  1997-05-26
7   1997-10-07  1997-10-21
8   1997-12-25  1998-01-08
9   1998-01-19  1998-02-02
10  1998-08-05  1998-08-19
</code></pre>

<p>I'd like to know how many times each individual date is contained between <code>start_dt</code> and <code>end_dt</code>.</p>

<p>From my example, the result set should look something like this</p>

<pre><code>date         count
------------------
1951-12-05   1
1951-12-06   1
...
1951-12-19   2
1951-12-20   2
1951-12-21   2
...
1998-08-19   1
</code></pre>

<p>What would be the best way to do this?</p>

<p>EDIT:  To clarify, I need each date that appears at least once in a date range (between start_dt and end_dt) to get a row in my result set and I want the number of ranges that this date fits in next to it</p>

<p>hope this helps</p>