Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Usage of Mysql temporary Table

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Mysql temporary table concept * occasionally need to run many queries to get a subset of a large amount of data * temporary tables exist when connecting to the database Disconnect, automatically delete the table and free up space * two different connections can use the same temporary table name, and the two will not conflict with each other * when creating, use the keyword IF NOT EXISTS to prevent errors in creating temporary tables create temporary table if not exists tmp_table (name VARCHAR (10) NOT NULL,value INTEGER NOT NULL,userName varchar (500), phone varchar (500)) Import query results into temporary tables select user_id, phone select username, depositionfrom user, compaywhere user.id = compay.idorder by user.cityINTO TEMP user_compay query temporary tables select * from user_company create and import results into temporary tables CREATE TEMPORARY TABLE tmp_table AS (SELECT * FROM table_name where xxx)

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report