In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the principle and creation method of Mysql temporary table, which is introduced in detail through the sample code, which has a certain reference value for everyone's study or work. Friends who need it can refer to it.
Mysql can create a temporary table using the temporary keyword. The created table disappears automatically when the session with the server is terminated.
Syntax: create temporary table tbl_name...
Rule: each session can only see the temporary table created by itself, and different sessions can create temporary tables with the same table name. The table name of a temporary table can be the same as the name of a permanent table.
Benefits: you can use temporary tables to save some temporary data, and break the meeting to automatically clear the data.
Disadvantages:
1. The session was unexpectedly disconnected from the server and the temporary table will be deleted.
two。 Temporary tables are only visible for creation sessions, so they cannot be shared with thread pool connection technology
3. It may conflict with the permanent table, causing the data of the permanent table to be mismanipulated after reconnection. To avoid deleting the same indicated permanent table, you can use drop temporary table_name when performing the delete table structure
Create a temporary table
Create temporary table student_copy (id int primary key, name varchar (20)) Engine=InnoDB default charset utf8
Ps: temporary table is created and cannot be seen with show tables
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
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.