netezza 数据库 取 季初 季末 时间
-- 取季初那一天
select date_trunc( 'quarter',cast('20150820' as date))
-- 取季末那一天
select add_months(date_trunc( 'quarter',cast('20150820' as date)) + INTERVAL '-1 day',3)
-- 取上季末那一天
select date_trunc( 'quarter',cast('20150820' as date)) + INTERVAL '-1 day'
-- 取上季初那一天
select add_months(date_trunc( 'quarter',cast('20150820' as date)),-3)
相关文章