Mysql-study

Mysql 學習

 

一、mysql的數據類型mysql

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

   b'11':二進制數據11;學習

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

 查詢二進制格式數據顯示it

 

二、日期類型io

     2-一、TIMESTAMPtable

  1.4個字節儲存(Time stamp value is stored in 4 bytes)test

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

  3.時區轉化 ,存儲時對當前的時區進行轉換,檢索時再轉換回當前的時區。select

 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.)

相關文章
相關標籤/搜索