title: Sql Postgres double group by
body: <p>I've got table with three columns: place_id, date, value. For each place for each date there is value, for example<br/></p>
  
  <p>place_id: 1, date: '2014-01-01', value: 1<br/>
  place_id: 2, date: '2014-01-01', value: 2<br/>
  place_id: 1, date: '2014-02-02', value: 3<br/>
  place_id: 1, date: '2014-02-03', value: 4<br/>
  place_id: 2, date: '2014-02-15', value: 5<br/></p>
  
  <p>My goal is to find for each month sum of max value for all places.
  In the context of data above it should looks like (don't matter how date must be showed like - as two columns year and month or one column 'yyyy-MM-01'):<br/></p>
  
  <p>date: '2014-01-01', sum_of_max: 3<br/>
  date: '2014-02-01', sum_of_max: 9<br/></p>
  
  <p>As I got, I have to use group by twice - firstly to get maximum value for month and place, secondly to summarize maximums I got on first step. But what way let me do it with best performance?</p>
  
  <p>P.S. If it's matter, I'm using PostgreSql 9.2</p>