Date functions
Truncate functions
There are some functions which you can use to truncate the date fields in the Projection section.
TO_DAY, TO_WEEK, TO_MONTH, TO_QUARTER, TO_YEAR
SELECT TO_MONTH(submittedAt) as 'Month' WHERE project.id = 1 GROUP BY 'Month'
Result: 2016-01-01, 2016-02-01 ...
Date part functions
There are some functions which you can use to get a part of the date fields in the Projection section. GET_DAY, GET_WEEK, GET_MONTH, GET_QUARTER, GET_YEAR
SELECT GET_MONTH(submittedAt) as 'Month' WHERE project.id = 1 GROUP BY 'Month'
Result: 1,2,....
Was this helpful?