From ea64d5e66d753614266367003e964a90b8f4a2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=BC=80=E7=AE=B1?= Date: Sat, 11 Feb 2023 17:04:28 +0800 Subject: [PATCH] =?UTF-8?q?Update=2020230208.1=20=E2=AD=90=EF=B8=8F?= =?UTF-8?q?=E2=AD=90=EF=B8=8F=20Improve=20your=20coding=20skills=20with=20?= =?UTF-8?q?temporal=20values=20in=20MySQL.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...⭐️ Improve your coding skills with temporal values in MySQL.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md b/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md index 9c3ef1987d..11df777198 100644 --- a/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md +++ b/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md @@ -31,8 +31,6 @@ First, the range of dates that can be used differ. `DATETIME` can hold dates bet Second, while both data types allow you to `auto_initialize` or `auto_update` their respective values (with `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` respectively), doing so was not available for `DATETIME` values until version 5.6.5. You can use one of the MySQL synonyms for `CURRENT_TIMESTAMP` if you choose, such as `NOW()` or `LOCALTIME()`. -**[ Download now: [MariaDB and MySQL cheat sheet][1] ]** - If you use `ON UPDATE CURENT_TIMESTAMP` (or one of its synonyms) for a `DATETIME` value, but do not use the `DEFAULT CURRENT_TIMESTAMP` clause, then the column will default to `NULL`. This happens unless you include `NOT NULL` in the table definition, in which case it defaults to zero. Another important thing to keep in mind is that although normally neither a `DATETIME` nor a `TIMESTAMP` column have a default value unless you declare one, there is one exception to this rule. The first `TIMESTAMP` column in your table is implicitly created with both `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` clauses if neither is specified and if the variable `explicit_defaults_for_timestamp` is disabled.