In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Let's talk about how to quickly set the automatic add time and update time in the MySQL field. The secret of the text is that it is close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading this article on how to quickly set the automatic add time and update time in the MySQL field.
Description:
The setting time field in the MySQL field automatically adds the creation time and automatic update time settings
Set the field type to: timestamp default is set to current_timestamp ()
The update time field type is: timestamp default value is set to current_timestamp () ON UPDATE current_timestamp ()
SQL syntax and examples create table tb_name (join_time timestamp NULL DEFAULT current_timestamp (), update_time timestamp NULL DEFAULT current_timestamp () ON UPDATE current_timestamp ()) CREATE TABLE mytb (join timestamp NULL DEFAULT current_timestamp (), update timestamp NULL DEFAULT current_timestamp () ON UPDATE current_timestamp (), name varchar (12) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
Data insertion verification
Mysql > insert into mytb (name) value ('xiaoming')
Data update verification
Mysql > update mytb set name= "floret"
Query verification
Is there anything you don't understand about how to quickly set up automatic add time and update time related content in the above MySQL field? Or if you want to know more about it, you can continue to follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.