title: Group by month in Oracle
body: <p>I'm trying to group by month in oracle, but I'm getting an invalid identifier on the "YEAR" function, not sure why.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>SELECT CAST(MONTH(day_date) AS VARCHAR(2)) + '-' + CAST(YEAR(day_date) AS VARCHAR(4)) AS MY_DATE,
  sum(cash_sales) as cash_sales, sum(unit_sales) as unit_sales
  FROM NC_SALES_CAT_TL
  GROUP BY CAST(MONTH(day_date) AS VARCHAR(2)) + '-' + CAST(YEAR(day_date) AS VARCHAR(4))
  </code></pre>
  
  <p>How can I accomplish the desired grouping by month?</p>