Insert value to a YEAR type column : YEAR « Data Types « MySQL Tutorial






mysql>
mysql> CREATE TABLE myTable(
    ->    ID TINYINT UNSIGNED NOT NULL DEFAULT 1,
    ->    Copyright YEAR,
    ->    Name VARCHAR(50) NOT NULL
    -> );
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql>
mysql> INSERT INTO myTable (ID, Copyright, Name)VALUES (1,1994,'A');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> select * from myTable;
+----+-----------+------+
| ID | Copyright | Name |
+----+-----------+------+
|  1 |      1994 | A    |
+----+-----------+------+
1 row in set (0.00 sec)

mysql>
mysql> drop table myTable;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>








10.26.YEAR
10.26.1.YEAR
10.26.2.YEAR column type
10.26.3.Insert value to a YEAR type column
10.26.4.Two-digit year
10.26.5.Four-digit year
10.26.6.To determine how many years served