Charts

From Data Islands
Revision as of 12:46, 10 August 2022 by WikiSysopdi (talk | contribs) (Created page with " Examples: # Northwind Orders table SQL select EXTRACT(month from TO_DATE("OrderDate",'MM')) AS "MON", TO_CHAR(TO_DATE("OrderDate",'MM/DD/YYYY'), 'Month') AS "Month", SUM(1) from orders group by  EXTRACT(month from TO_DATE("OrderDate",'MM')) , TO_CHAR(TO_DATE("OrderDate",'MM/DD/YYYY'), 'Month') order by EXTRACT(month from TO_DATE("OrderDate",'MM'))")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)




Examples:

  1. Northwind Orders table


SQL


select EXTRACT(month from TO_DATE("OrderDate",'MM')) AS "MON", TO_CHAR(TO_DATE("OrderDate",'MM/DD/YYYY'), 'Month') AS "Month", SUM(1)

from orders

group by  EXTRACT(month from TO_DATE("OrderDate",'MM')) , TO_CHAR(TO_DATE("OrderDate",'MM/DD/YYYY'), 'Month')

order by EXTRACT(month from TO_DATE("OrderDate",'MM'))