2021
01-08
01-08
postgresql 实现得到时间对应周的周一案例
两种方法:第一种:DO$$declaredint;declared1varchar(100);declared2varchar(100);declared3date;declared4date;begind3:=CURRENT_DATE;d1:='selectdate'''||d3||'''';d:=(SELECTEXTRACT(DOWFROMd3))-1;d2:=d1||'-INTERVAL'''||d||'day''';EXECUTEd2intod4;RAISENOTICE'ok%',d4;end$$结果:[SQL]DO$$declaredint;declared1varchar(100);declared2varchar(100);declared3date;declare...
继续阅读 >