久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='CMyEM'><style id='CMyEM'><dir id='CMyEM'><q id='CMyEM'></q></dir></style></legend>
<i id='CMyEM'><tr id='CMyEM'><dt id='CMyEM'><q id='CMyEM'><span id='CMyEM'><b id='CMyEM'><form id='CMyEM'><ins id='CMyEM'></ins><ul id='CMyEM'></ul><sub id='CMyEM'></sub></form><legend id='CMyEM'></legend><bdo id='CMyEM'><pre id='CMyEM'><center id='CMyEM'></center></pre></bdo></b><th id='CMyEM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CMyEM'><tfoot id='CMyEM'></tfoot><dl id='CMyEM'><fieldset id='CMyEM'></fieldset></dl></div>
      • <bdo id='CMyEM'></bdo><ul id='CMyEM'></ul>
      <tfoot id='CMyEM'></tfoot>

      1. <small id='CMyEM'></small><noframes id='CMyEM'>

      2. 如何為 MySQL 日期時間列設置默認值?

        How do you set a default value for a MySQL Datetime column?(如何為 MySQL 日期時間列設置默認值?)

        1. <i id='3uKpN'><tr id='3uKpN'><dt id='3uKpN'><q id='3uKpN'><span id='3uKpN'><b id='3uKpN'><form id='3uKpN'><ins id='3uKpN'></ins><ul id='3uKpN'></ul><sub id='3uKpN'></sub></form><legend id='3uKpN'></legend><bdo id='3uKpN'><pre id='3uKpN'><center id='3uKpN'></center></pre></bdo></b><th id='3uKpN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3uKpN'><tfoot id='3uKpN'></tfoot><dl id='3uKpN'><fieldset id='3uKpN'></fieldset></dl></div>
          <tfoot id='3uKpN'></tfoot>

          <small id='3uKpN'></small><noframes id='3uKpN'>

              <tbody id='3uKpN'></tbody>

            <legend id='3uKpN'><style id='3uKpN'><dir id='3uKpN'><q id='3uKpN'></q></dir></style></legend>

              <bdo id='3uKpN'></bdo><ul id='3uKpN'></ul>
                  本文介紹了如何為 MySQL 日期時間列設置默認值?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  如何為 MySQL 日期時間列設置默認值?

                  How do you set a default value for a MySQL Datetime column?

                  在 SQL Server 中,它是 getdate().MySQL 的等效項是什么?如果這是一個因素,我正在使用 MySQL 5.x.

                  In SQL Server it's getdate(). What is the equivalant for MySQL? I'm using MySQL 5.x if that is a factor.

                  推薦答案

                  重要MySQL 5.6.5 開始,現在可以使用 DATETIME 字段來實現這一點,請查看 其他帖子 下面...

                  IMPORTANT It is now possible to achieve this with DATETIME fields since MySQL 5.6.5, take a look at the other post below...

                  以前的版本不能用 DATETIME...

                  Previous versions can't do that with DATETIME...

                  但是你可以用 TIMESTAMP 來做到:

                  But you can do it with TIMESTAMP:

                  mysql> create table test (str varchar(32), ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
                  Query OK, 0 rows affected (0.00 sec)
                  
                  mysql> desc test;
                  +-------+-------------+------+-----+-------------------+-------+
                  | Field | Type        | Null | Key | Default           | Extra |
                  +-------+-------------+------+-----+-------------------+-------+
                  | str   | varchar(32) | YES  |     | NULL              |       | 
                  | ts    | timestamp   | NO   |     | CURRENT_TIMESTAMP |       | 
                  +-------+-------------+------+-----+-------------------+-------+
                  2 rows in set (0.00 sec)
                  
                  mysql> insert into test (str) values ("demo");
                  Query OK, 1 row affected (0.00 sec)
                  
                  mysql> select * from test;
                  +------+---------------------+
                  | str  | ts                  |
                  +------+---------------------+
                  | demo | 2008-10-03 22:59:52 | 
                  +------+---------------------+
                  1 row in set (0.00 sec)
                  
                  mysql>
                  

                  CAVEAT: 如果您定義了一個默認設置為 CURRENT_TIMESTAMP ON 的列,您將需要始終為此列指定一個值,否則該值將自動重置為now()"在更新.這意味著如果您不想更改該值,則您的 UPDATE 語句必須包含[您的列名] = [您的列名]";(或某個其他值)或該值將變為now()".很奇怪,但確實如此.我正在使用 5.5.56-MariaDB

                  這篇關于如何為 MySQL 日期時間列設置默認值?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                    <tbody id='CmrBO'></tbody>

                  1. <small id='CmrBO'></small><noframes id='CmrBO'>

                    <i id='CmrBO'><tr id='CmrBO'><dt id='CmrBO'><q id='CmrBO'><span id='CmrBO'><b id='CmrBO'><form id='CmrBO'><ins id='CmrBO'></ins><ul id='CmrBO'></ul><sub id='CmrBO'></sub></form><legend id='CmrBO'></legend><bdo id='CmrBO'><pre id='CmrBO'><center id='CmrBO'></center></pre></bdo></b><th id='CmrBO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CmrBO'><tfoot id='CmrBO'></tfoot><dl id='CmrBO'><fieldset id='CmrBO'></fieldset></dl></div>

                    • <tfoot id='CmrBO'></tfoot>
                        <bdo id='CmrBO'></bdo><ul id='CmrBO'></ul>
                        <legend id='CmrBO'><style id='CmrBO'><dir id='CmrBO'><q id='CmrBO'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 久久手机免费视频 | 免费在线观看黄 | 91激情视频 | 台湾av在线 | 日韩av在线免费播放 | 黄色一极片 | 欧美精品在线看 | 国产永久精品 | 中文字幕国产精品 | 国产精品一| 欧美精品日韩少妇 | 亚洲精品成人在线 | 色婷婷视频在线观看 | 亚洲国产欧美日韩在线 | 国产亚洲精品成人av久久ww | 香蕉在线观看视频 | 久久久精品在线观看 | 亚洲动漫精品 | 久久在线免费观看 | 亚洲第一毛片 | 精品伊人久久 | 天天操夜夜爽 | 久久亚洲综合 | av片在线免费观看 | 国产精品成人一区二区网站软件 | 1级黄色大片| www.亚洲国产| 91成年人 | 在线观看av片| 超碰人人人 | 他揉捏她两乳不停呻吟动态图 | 国产成人午夜 | 亚洲第一毛片 | 999精品在线 | 色综合色综合 | 色婷婷精品国产一区二区三区 | 久久久久国产一区二区三区 | 国产精品久久久久久久 | 国产精品久久久久久中文字 | 精产国产伦理一二三区 | 久久机热这里只有精品 |