Re: Re: Re: Re: Untitled

From Torrid Panda, 2 Months ago, written in Plain Text, viewed 104 times. This paste is a reply to Re: Re: Re: Untitled from Sharp Terrapin - view diff
URL http://codebin.org/view/e5d176cc Embed
Download Paste or View Raw
  1. SELECT *
  2. FROM
  3. (SELECT count(total) as year_2011,
  4. EXTRACT(month from CAST(invoice_date AS timestamp)) as month
  5. FROM invoice
  6. where EXTRACT(YEAR FROM CAST(invoice_date AS timestamp))=2011
  7. GROUP BY month) as year2011
  8. FULL JOIN
  9. (SELECT count(total) as year_2012
  10. EXTRACT(month from CAST(invoice_date AS timestamp)) as month
  11. FROM invoice
  12. where EXTRACT(YEAR FROM CAST(invoice_date AS timestamp))=2012
  13. GROUP BY month) as year2012 ON year2011.month=year2012.month

Reply to "Re: Re: Re: Re: Untitled"

Here you can reply to the paste above