title: group by date aggregate function in postgresql
body: <p>I'm getting an error running this query</p>
  
  <pre><code>SELECT date(updated_at), count(updated_at) as total_count 
  FROM "persons"
  WHERE ("persons"."updated_at" BETWEEN '2012-10-17 00:00:00.000000' AND '2012-11-07     12:25:04.082224') 
  GROUP BY date(updated_at)
  ORDER BY persons.updated_at DESC
  </code></pre>
  
  <p>I get the error ERROR:  column "persons.updated_at" must appear in the GROUP BY clause or be used in an   aggregate function LINE 5: ORDER BY persons.updated_at DESC</p>
  
  <p>This works if I remove the date( function from the group by call, however I'm using the date function because i want to group by date,  not datetime</p>
  
  <p>any ideas</p>