This article mainly introduces the principle and creation method of Mysql temporary table. The example code in this article is very detailed and has a certain reference value for everyone's study or work. Friends in need can refer to it. mysql can create a temporary table using the temporary keyword. The created table will automatically disappear when the session with the server ends. Syntax: create temporary table tbl_name...; Rules: Each session can only see the temporary tables it created. Different sessions can create temporary tables with the same table name. The name of a temporary table can be the same as that of a permanent table. Advantages: You can use temporary tables to save some temporary data, and automatically clear the data when the session is disconnected harm: 1. If you accidentally disconnect from the server, the temporary table will be deleted. 2. Temporary tables are only visible to the session that created them, so they cannot be used simultaneously with thread pool connection technology. 3. It may conflict with the permanent table, resulting in incorrect operation of the permanent table data after reconnection. To avoid deleting permanent tables with the same structure, you can use drop temporary table_name when deleting the table structure; Create a temporary table create temporary table student_copy( id int primary key, name varchar(20) )Engine=InnoDB default charset utf8; ps: The temporary table is created, but cannot be seen using show tables The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Mysql backup multiple database code examples
>>: React Native startup process detailed analysis
Regular expressions are often used to search and ...
Sometimes, we need to copy a whole column of data...
Install FFmpeg flac eric@ray:~$ sudo apt install ...
1. Install dependency packages yum -y install gcc...
like LIKE requires the entire data to match, whil...
Good HTML code is the foundation of a beautiful w...
Docker Compose can realize the orchestration of D...
A singly linked list can only be traversed from t...
I recently upgraded a test server operating syste...
Preface Tip: The following is the main content of...
Table of contents WXS Response Event Plan A Page ...
This article shares the installation steps of MyS...
1. flex-grow, flex-shrink, flex-basis properties ...
Table of contents When to use Structural branches...
Table of contents $nextTick() $forceUpdate() $set...