您的位置:首页 > 数据库 > MySQL

Mysql-study

2016-12-15 00:00 197 查看

Mysql 学习

1、mysql的数据类型

CREATE table zsw.testBit(id BIT(8));
insert into zsw.testbit values(121),(b'11');.

b'11':二进制数据11;

select bin(id+0) from zsw.testbit;

查询二进制格式数据显示

2、日期类型

2-1、TIMESTAMP

  1.4个字节储存(Time stamp value is stored in 4 bytes)

  2.值以UTC格式保存( it stores the number of milliseconds)

  3.时区转化 ,存储时对当前的时区进行转换,检索时再转换回当前的时区。

 2-2、datetime

  1.8个字节储存(8 bytes storage)

  2.实际格式储存(Just stores what you have stored and retrieves the same thing which you have stored.)

  3.与时区无关(It has nothing to deal with the TIMEZONE and Conversion.)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: