title: Two-column SQL count query with first column having static labels
body: <p>I am using Oracle 10g and I have a table called downloads which basically looks like this:</p>
  
  <pre><code>ID     DOWNLOAD_DATE
  1      2011-02-10
  2      2011-03-10
  3      2011-04-10
  4      2011-05-10
  5      2011-01-11
  6      2011-04-22
  7      2011-02-18
  8      2011-03-14
  9      2011-02-01
  10     2011-01-31
  </code></pre>
  
  <p>etc.</p>
  
  <p>I would like to execute a query that returns the following:</p>
  
  <pre><code>Downloads today
  Downloads yesterday
  Downloads from start date until today
  Downloads on start date
  Downloads on day after start date
  </code></pre>
  
  <p>I would like to print the results in two columns. In the first column I'd like to put a static label, like the ones above. And in the second column the count.</p>
  
  <p>I've tried something like this:</p>
  
  <pre><code>select count(id) from downloads where download_date = '2007-08-06'
  union
  select count(id) from downloads where download_date = '2007-08-08'
  </code></pre>
  
  <p>But this has 2 problems. One, it only prints one column, the count. Two, if there is no data for a given date (or range of dates), nothing is printed. I need a zero to be printed.</p>
  
  <p>So then I tried something like this:</p>
  
  <pre><code>select download_date, count(download_date) from downloads where download_date = '2007-08-06'
  group by download_date
  union
  select download_date, count(download_date) from downloads where download_date &gt; '2007-08-08'
  group by download_date
  </code></pre>
  
  <p>This returns two columns but the first column isn't static, it's a field in the database (download_date). And more importantly, it returns multiple rows for query that selects a range of dates (where download_date > '2007-08-08'), whereas I just want one row, with its count.</p>
  
  <p>How can I do this?</p>
  
  <p>Many thanks,
  Bob</p>