久久久久久久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大神xh98xh系列全部 | 日本黄色大片免费 | 国产成人99 | 日韩欧美亚洲 | 国产成人精品久久久 | 干干干日日日 | 在线视频一区二区三区 | 欧美成人在线影院 | 国产欧美精品区一区二区三区 | 免费黄色大片 | 欧美日韩在线成人 | 亚洲网站在线观看 | 欧美一级二级在线观看 | 天天爽夜夜操 | 国产成人福利视频 | 91精品国产手机 | 日韩欧美国产一区二区 | 五十女人一级毛片 | 成年人网站国产 | 最新av在线播放 | 俺去俺来也www色官网cms | 色av一区| 日韩在线不卡 | 国产ts一区 | 紧缚调教一区二区三区视频 | 国产特级毛片 | 精品国产一区二区在线 | 久久一区视频 | 成人免费黄色片 | 免费视频一区 | 蜜月va乱码一区二区三区 | 国产色片| 中文字幕在线一区 | 性色视频在线观看 | 日韩免费激情视频 |