The YEAR type is used to represent a year in the four-digit format.
A YEAR value is searched and displayed in the YYYY format. The value is 0000 or ranges from 1901 to 2155.
The syntax of YEAR is as follows:
YEAR[(4)]
OceanBase Database allows you to assign string or numeric values to a YEAR column.
You can enter a YEAR value in the following formats:
A string of four characters in the range of '1901' to '2155'.
A four-digit number in the range of 1901 to 2155.
A string of one or two characters in the range of '0' to '99'. OceanBase Database converts a
YEARvalue from "0" to "69" into a year from 2000 to 2069, and "70" to "99" into a year from 1970 to 1999.A one-digit or two-digit number in the range of 0 to 99. OceanBase Database converts a
YEARvalue from 1 to 69 into a year from 2001 to 2069, and 70 to 99 into a year from 1970 to 1999.If you insert the number 0, 0000 is displayed, and the internal value is 0000. To obtain the year 2000, you can specify the string "0" or "00".
You can use a function, such as
NOW(), to convert the return value into an expression of theYEARtype.