如题,Postgresql语句实现条件"每月第一个星期一"这一条件:
select 'Today is the first Monday of this month' where EXTRACT(DOW FROM now())=1 and EXTRACT(DAY from now()) < 7;
EXTRACT(DAY FROM now())表示从当前时间戳中获取当月第几天(范围为1-31,0)。
如题,Postgresql语句实现条件"每月第一个星期一"这一条件:
select 'Today is the first Monday of this month' where EXTRACT(DOW FROM now())=1 and EXTRACT(DAY from now()) < 7;
EXTRACT(DAY FROM now())表示从当前时间戳中获取当月第几天(范围为1-31,0)。