Amazon Redshift - 如何从 table 的现有每日日期字段中获取一周的开始日期?

Amazon Redshift- How to get start date of the Week from existing daily date field from the table?

我正在尝试从同一个 table 的现有每日日期字段中获取一周的开始日期。例如,从 05/08/2022 到 05/14/2022 的每日日期,对于一周中的所有日子,一周日期输出的开始日期需要为 05/08/2022。星期日开始。

同样要求月份和季度的第一个日期(3 个月的划分)

date_trunc() 函数执行此操作 - https://docs.aws.amazon.com/redshift/latest/dg/r_DATE_TRUNC.html