因为工作中需要,研究了一下,有问题大家一起交流
获取上月月末
select CAST((date_add('day'
, - day_of_month(current_date)
, current_date)) AS VARCHAR);
获取上月月初
select date_trunc('month', (date_add('day'
, - day_of_month(current_date)
, current_date)));
因为工作中需要,研究了一下,有问题大家一起交流
获取上月月末
select CAST((date_add('day'
, - day_of_month(current_date)
, current_date)) AS VARCHAR);
获取上月月初
select date_trunc('month', (date_add('day'
, - day_of_month(current_date)
, current_date)));