MONTH()

Description

The MONTH() function returns the month part for a given date (a number from 1 to 12).

Syntax

  1. > MONTH(date)

Arguments

ArgumentsDescription
dateRequired. The date/datetime to extract the month from

Examples

  1. > drop table if exists t1;
  2. > create table t1(a date, b datetime);
  3. > insert into t1 values('20211223','2021-10-22 09:23:23');
  4. > insert into t1 values('2021-12-23','2021-10-22 00:23:23');
  5. > select month(a) from t1;
  6. +----------+----------+
  7. | month(a) | month(b) |
  8. +----------+----------+
  9. | 12 | 10 |
  10. | 12 | 10 |
  11. +----------+----------+

Constraints

The date type supports only yyyy-mm-dd and yyyymmdd for now.

Currently, MatrixOne doesn’t support select function() without from tables.