如题,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)。
参考:http://www.jb51.cc/article/p-sawcdhxp-qs.html