In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how Mysql updates some fields of another table according to the data of one table. It is very detailed and has certain reference value. Friends who are interested must read it.
The specific code is as follows:
DROP TABLE IF EXISTS T_U_TEMPLATE -- template table CREATE TABLE T_U_TEMPLATE (ID INT NOT NULL AUTO_INCREMENT comment 'template table ID', TEMPLATE_CODE VARCHAR (50) BINARY comment' template coding', TEMPLATE_NAME VARCHAR (300) BINARY comment 'template name', CREATE_TIME datetime DEFAULT NULL COMMENT 'creation time', CREATE_BY varchar (64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'creator', UPDATE_BY varchar (64) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'updater' UPDATE_DATE datetime COMMENT 'update time', constraint PK_U_TEMPLATE primary key (ID)) DEFAULT CHARSET=utf8 comment 'template table' DROP TABLE IF EXISTS TEMPLATE_TEMP_CREATE;-- template temporary table CREATE TABLE TEMPLATE_TEMP_CREATE (ID INT NOT NULL AUTO_INCREMENT comment 'template table ID', OBJECT_ID VARCHAR (50) BINARY comment' template coding', OPERATER_NAME varchar (64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'updater', CREATE_TIME datetime NOT NULL COMMENT 'update time', constraint PK_U_TEMPLATE primary key (ID)) DEFAULT CHARSET=utf8 comment 'template temporary table' -- modify the creation time of the creator to the T_U_TEMPLATE table UPDATE T_U_TEMPLATE a minute templated create b SET a.CREATE_TIME=b.CREATE_TIME WHERE a.TEMPLATE_CODE = b. OBJECTCTED ID address update T_U_TEMPLATE a makeshift project create b SET a.CREATE_BY=b.OPERATER_NAME WHERE a.TEMPLATE_CODE = b.OBJECT_ID The above is all the content of the article "how Mysql updates some fields of another table based on one table data". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.