In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to use temporary tables in mysql. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Create a temporary table to store the query results
(1) mysql does not support the storage method:
Select * into tmp from maintenanceprocess
(2) you can use:
Create table tmp (select...)
For example:
# Top of single station maintenance result table drop table if EXISTS tmp_ single station maintenance result table (inspection report) Create table tmp_ single station maintenance result table (inspection report) upper part (select workAreaName as' machine number', m.jobNumber as' maintenance personnel number', u.userName as' maintenance personnel name', loginTime as' maintenance start time', CONCAT ((TIME_TO_SEC (exitTime)-TIME_TO_SEC (loginTime)) / 60) 'minutes') as' maintenance duration 'from maintenanceprocess as m LEFT JOIN user u ON m.jobNumber = u.jobNumber where m.jobNumber = [$maintenance personnel number] and loginTime = [$maintenance start time]) # create temporary table select * from tmp_ upper part of single station maintenance result table (inspection report)
Note: [$maintenance start time] is a value that can be entered for query
(3) an example of another way to create a temporary table:
In a stored procedure:
BEGIN#Routine body goes here...declare cnt int default 0 leading i int default 0 political set cnt = func_get_splitStringTotal; DROP TABLE IF EXISTS `tmp_ split`; create temporary table `tmp_ split` (`val_ `varchar) DEFAULT CHARSET=utf8;while I < cntdoset I = I + 1 × insert into tmp_split (`val_ `) values (func_splitString); end while END on how to use temporary tables in mysql to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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: 245
*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.