mysql xp系统时间_mysql时间类型year
`date:年月日
datetime:年月日時(shí)分秒,保存確定的時(shí)間點(diǎn)的時(shí)候,存儲(chǔ)形式y(tǒng)yyy-mm-dd hh:MM-dd,暫用8個(gè)字節(jié)
timestamp:時(shí)間從.存儲(chǔ)時(shí)是整形數(shù)字,表現(xiàn)形式是yyyy-mm-dd hh:MM-dd,暫用4個(gè)字節(jié),取值范圍,1970-01-01 00:00:00到2038
year:1個(gè)字節(jié)?? 1901-2155,可以用0000表示默認(rèn)值,如果輸入兩位'00-69'表示'2000-2069',如果輸入'70-99'表示'1970-1999'
----------------------------------------
針對(duì)year類型
create table history(
title VARCHAR(20) not null DEFAULT '',
years YEAR(4)
)
輸入:00或69或70或99
mysql> insert into history VALUES ('00','00'),('69','69'),('70','70'),('99','99');
Query OK, 4 rows affected (0.08 sec)
mysql> select * from history;
+-------+-------+
| title | years |
+-------+-------+
| 00??? |? 2000 |
| 69??? |? 2069 |
| 70??? |? 1970 |
| 99??? |? 1999 |
+-------+-------+
4 rows in set (0.00 sec)
為了便于理解,輸入的時(shí)候輸入4位范圍內(nèi)的數(shù)字
mysql> insert into history values ('minyear','1901'),('maxyear','2155');
Query OK, 2 rows affected (0.03 sec)
Records: 2? Duplicates: 0? Warnings: 0
mysql> select * from history;
+---------+-------+
| title?? | years |
+---------+-------+
| 00????? |? 2000 |
| 69????? |? 2069 |
| 70????? |? 1970 |
| 99????? |? 1999 |
| minyear |? 1901 |
| maxyear |? 2155 |
+---------+-------+
6 rows in set (0.00 sec)
--------------------------------------`
總結(jié)
以上是生活随笔為你收集整理的mysql xp系统时间_mysql时间类型year的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 细讲傅立叶变换
- 下一篇: 文末赠书100本 | 当下最火爆的机器学