The YEAR type is used to represent a year in a 4-digit format.
The retrieval and display format of a YEAR value is YYYY, ranging from 1901 to 2155, and 0000.
The syntax of YEAR is as follows:
YEAR[(4)]
OceanBase Database allows you to assign values to a YEAR column by using a string or a number.
The YEAR type supports the following input value formats:
A 4-digit string in the range from '1901' to '2155'.
A 4-digit number in the range from 1901 to 2155.
A 1-digit or 2-digit string in the range from '0' to '99'. OceanBase Database converts values in the range from '0' to '69' and from '70' to '99' to
YEARvalues in the range from 2000 to 2069 and from 1970 to 1999, respectively.A 1-digit or 2-digit number in the range from 0 to 99. OceanBase Database converts values in the range from 1 to 69 and from 70 to 99 to
YEARvalues in the range from 2001 to 2069 and from 1970 to 1999, respectively.If you insert 0, the displayed value is 0000, and the internal value is 0000. To convert it to 2000, you can specify it as the string "0" or "00".
An expression that returns a value that can be converted to the
YEARtype, such asNOW().
