mysql id用什么類型 mysql中,創(chuàng)建表時(shí)如何定義一個(gè)日期類型的字段?
mysql中,創(chuàng)建表時(shí)如何定義一個(gè)日期類型的字段?您好,MySQL字段與時(shí)間相關(guān)。datetime 8 bytes yyy-MM-DD HH:MM:SS 1000-01-01 00:00:00~999
mysql中,創(chuàng)建表時(shí)如何定義一個(gè)日期類型的字段?
您好,MySQL字段與時(shí)間相關(guān)。
datetime 8 bytes yyy-MM-DD HH:MM:SS 1000-01-01 00:00:00~9999-12-31 23:59:59
時(shí)間戳4 bytes yyy-MM-DD HH:MM:SS 1970-01-01 00:00:01~2038
date 3 bytes yyy-MM-DD 1000-01-01~9999-12-31
年份1 bytes yyyyy 1901~2155就我個(gè)人而言,我經(jīng)常使用datetime
方法:
要查看數(shù)據(jù)庫(kù)表的創(chuàng)建時(shí)間,您可以單擊uview
schema中的信息uu schema database table description:
schema table:提供當(dāng)前MySQL實(shí)例中所有數(shù)據(jù)庫(kù)的信息。此表是顯示數(shù)據(jù)庫(kù)的結(jié)果。
表:提供有關(guān)數(shù)據(jù)庫(kù)中表的信息,包括視圖。它詳細(xì)描述了表所屬的模式、表類型、表引擎、創(chuàng)建時(shí)間等信息。是從架構(gòu)名稱顯示表的結(jié)果。
數(shù)據(jù)庫(kù)表的創(chuàng)建時(shí)間在create of tables table time字段中
選擇create time FROM tables WHERE table Schema=“database name”and table name=“table name”
用要查詢的數(shù)據(jù)替換上面的數(shù)據(jù)庫(kù)名和表名。