title: Ordering by month & year numbers in Postgres
body: <p>I have the blow query that I'm trying to use in a BI tool.</p>
  
  <pre><code>select
  to_char(date_trunc('month', l.date_created)::date, 'Month YYYY') as "Month / Year",
    count(distinct l.lead_id) as "# New Leads"
    from leads l
    where l.date_created &gt;= {{date_range_start}} and l.date_created &lt;= {{date_range_end}}
    group by date_trunc('month', l.date_created)
  </code></pre>
  
  <p>The grouping is working correctly, but I can't figure out how to write the order by to get the results to come back in descending order of month and year (going by numbers, not "january vs april" alphabetical)</p>