SQL · Functions and expressions
date_trunc()
Truncates a timestamp to a unit, ideal for grouping by period.
Syntax
date_trunc('month', ts)Example
Open in the lab
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.