title: SQL, Get counts for each date with slight twist
body: <p>I have order, and ordereditemline where ordereditemline is each line(product) in the order.  </p>
  
  <p>Each line (product) has an associated date.  (You can think of a ticket product which has a specified date)</p>
  
  <p>I've simplified the tables as below.</p>
  
  <pre><code>create table order  (
   id integer NOT NULL,
  )
  
  
  CREATE TABLE order_ordereditemline (
      id integer NOT NULL,
      order_id integer NOT NULL,
      date_at date,
      );
  </code></pre>
  
  <p>For a given date range, I'd like to get order count for each date.<br>
  ([8/11: 3, 8/12: 0, 8/13: 4 ...])</p>
  
  <p><code>8/11: 3</code> means there is 3 orders which has at least a line with date_at 8/11.</p>
  
  <p>It is possible that for a total of 100 orders in a date range, sum of counts for each date could exceed 100. </p>
  
  <p>Not sure if this is possible with sql..
  I'm using postgres, if it matters. </p>