MySQL 如何使用 YEAR 数据类型在表中存储年份值?
mysqlmysqli database更新于 2025/3/31 18:20:17
MySQL 允许声明一个列 YEAR 类型,借助该类型,我们可以在该列中存储年份值。
mysql> Create table year1 (Year_Copyright YEAR); Query OK, 0 rows affected (0.21 sec) mysql> Insert into year1(Year_Copyright) values (2017); Query OK, 1 row affected (0.08 sec) mysql> Select * from year1; +----------------+ | Year_Copyright | +----------------+ | 2017 | +----------------+ 1 row in set (0.00 sec)
相关文章
有用资源
mysql 参考教程 - 该教程包含有关 mysql 的更多信息:https://www.cainiaomax.com/mysql/

