当前位置:网站首页>MySql copies data from one table to another table
MySql copies data from one table to another table
2022-08-02 06:09:00 【web15286201346】
1. Copy the data of the old table to the new table (assuming the two tables have the same structure) INSERT INTO new table SELECT * FROM old table
INSERT INTO tbl_user_copy SELECT * FROM tbl_user;
Data volume: 5 million, time: 138.678s (2.3 minutes);
Time to delete 5 million data: 142.89s (2.38 minutes)

2. Copy the table structure and data to the new table CREATE TABLE target table name SELECT * FROM source table name
select * into target table name from source table name (requires that the target table does not exist, because it will be automatically created when inserting) (Note: this statement is not suitable for mysql)
Statement: CREATE TABLE tbl_user_copy SELECT * FROM tbl_user
Data volume: 5 million, time: 113.266s;
3. Only copy the table structure:
CREATE TABLE new table
SELECT * FROM old table WHERE 1=2
3. Table backup with different table structure
INSERT INTO new table (field1, field2,....)
SELECT field1, field2,... FROM old table
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 选择黑盒测试用例设计方法的综合策略方案总结
- MySQL 5.7详细下载安装配置教程
- MySql字符串拆分实现split功能(字段分割转列、转行)
- CubeSat Light-1
- MySQL 5.7升级到8.0详细过程
- MySQL 5.7 upgrade to 8.0 detailed process
- MySQL安装教程
- The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
- 力扣 2127. 参加会议的最多员工数 拓扑剪枝与2360补充
- 一线大厂软件测试流程(思维导图)详解
猜你喜欢

认识CAN光纤转换器的光纤接口和配套光纤线缆

ApiPost 真香真强大,是时候丢掉 Postman、Swagger 了

canvas 像素操作(图片像素操作)

Google 安装印象笔记剪藏插件

CNN 理解神经网络中卷积(大小,通道数,深度)
[email protected](using passwordYES)"/>Navicat报错:1045-Access denied for user [email protected](using passwordYES)

公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范

Go语学习笔记 - 处理超时问题 - Context使用 从零开始Go语言

UE4 蓝图实现AI随机移动

MYSQL 唯一约束
随机推荐
MYSQL unique constraint
力扣 2127. 参加会议的最多员工数 拓扑剪枝与2360补充
How to quickly delete the compressed package password?
MySQL 5.7详细下载安装配置教程
matlab simulink 飞机飞行状态控制
Mycat2.0搭建教程
canvas 像素操作(图片像素操作)
MySql将一张表的数据copy到另一张表中
软件测试常见的问题
从DES走到AES(现代密码的传奇之路)
【Gazebo入门教程】第一讲 Gazebo的安装、UI界面、SDF文件介绍
MySQL 的 limit 分页查询及性能问题
Matlab学习第二天
一线大厂软件测试流程(思维导图)详解
Does Conway's Law Matter for System Architecture?
What do interview test engineers usually ask?The test supervisor tells you
【语义分割】FCN
RADIUS 如何提高 WiFi 无线网络安全性?
WiFi、蓝牙、zigbee锁与NB、Cat.1锁的区别
【QT】Qt Creator生成动态库(DLL)并调用