The YEAR data type is used to represent a four-digit year.
The retrieval and display format for YEAR values is YYYY, with a range from 1901 to 2155, and 0000.
The syntax for YEAR is as follows:
YEAR[(4)]
OceanBase AI Database allows you to assign values to the YEAR column using either strings or numbers.
The YEAR data type supports the following input formats:
A four-digit string in the range of '1901' to '2155'.
A four-digit number in the range of 1901 to 2155.
A one- or two-digit string in the range of '0' to '99'. OceanBase AI Database converts values in the ranges "0" to "69" and "70" to "99" into
YEARvalues in the ranges 2000 to 2069 and 1970 to 1999, respectively.A one- or two-digit number in the range of 0 to 99. OceanBase AI Database converts values in the ranges 1 to 69 and 70 to 99 into
YEARvalues in the ranges 2001 to 2069 and 1970 to 1999, respectively.When the number 0 is inserted, the displayed value is 0000 and the internal value is also 0000. To convert it to 2000, you can specify it as the string "0" or "00".
The return value can be converted to an expression of the
YEARtype, such asNOW().