云数据库 GAUSSDB-时间/日期函数:month()

时间:2025-08-28 15:00:55

month()

描述:返回从过去日期开始的月份。

参数:入参为指定提取的日期时间,是时间类型表达式、TEXT、DATETIME、DATE或TIME等类型。

返回值类型:int

示例:

gaussdb=# SELECT month('2021-11-30');
 month 
-------
    11
(1 row)

该函数在sql_compatibility = 'B',且参数b_format_version值为5.7、b_format_dev_version值为s1时有效。

support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-42-2016.html