你说你看不懂openGauss我都不信(百七十)

47 阅读1分钟

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/

month

如果source为timestamp,表示一年里的月份数(1-12)。

openGauss=# SELECT EXTRACT(MONTH FROM TIMESTAMP '2001-02-16 20:38:40');
 date_part 
-----------
         2
(1 row)

如果source为interval,表示月的数目,然后对12取模(0-11)。

openGauss=# SELECT EXTRACT(MONTH FROM INTERVAL '2 years 13 months');
 date_part 
-----------
         1
(1 row)

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/