当前位置:网站首页>【MySQL】 insert into ... select ...
【MySQL】 insert into ... select ...
2022-07-21 12:04:00 【sayyy】
The table structures of the two tables are the same
insert into sys_menu
select *
from sys_menu_back
where menu_id=2092;
When copying data from the same table
insert into sys_menu
select *
from sys_menu
where menu_id=2092 or parent_id=2092;
- Report errors :
ERROR #1062
1. Concatenate all column names of the table into strings
SELECT GROUP_CONCAT(CONCAT('`', `column_name`, '`') ORDER BY `ordinal_position`)
FROM `information_schema`.`columns`
WHERE `table_schema`=DATABASE() AND `table_name`='sys_menu';
2 To write insert into … select …
insert into `sys_menu` (`menu_name`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`)
select `menu_name`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`
from `sys_menu`
where `menu_id`=2092;
边栏推荐
- 创建型模式之单例模式
- Leetcode挺进10W
- 2021-9-21
- "Fundamentals of program design" Chapter 10 function and program structure 6-6 recursive implementation sequential output integer (15 points)
- 为什么 this.$refs[formName].validate((valid) =>{} 无效(没有反应)
- 一级建造师证怎么考?手把手教你,看完这篇文章就都懂了!
- Distributed high concurrency and high availability fastdfs file server cluster deployment
- 【thymeleaf】基本对象:Base objects
- Leetcode 展望2021
- KDD cup 2022 Baidu - 榜单
猜你喜欢
支持向量机学习笔记(2)参数比较与人脸识别项目
mysql数据库 if buf[0] == 251: # \xfb IndexError: bytearray index out of range
MySQL实现基于binlog的主从同步、主主同步
2021-9-21
node 读取出某一个文件夹内的所有文件路径(此处会遍历所有文件夹,如有其他操作看着加就行了)
How many identical characters are there in the MySQL query string (the query string contains a specific number of identical characters)
使用 FVTool 进行滤波器分析
HTB-Lame
Jetson tx2 NX是个怎样的产品?(Jetson tx2 NX如何提供强大的能效)
个人学习 _numpy
随机推荐
让软件开发民主化的低代码
Prototype mode of creation mode
海外APP推送(上篇):厂商通道与谷歌FCM通道的差异
The getsubmittedfilename() method is unavailable
"Fundamentals of program design" Chapter 10 function and program structure 6-11 recursive calculation of P function (15 points)
2021-09-16
三星宣布完成5纳米EUV工艺研发:性能提高10%,功耗降低20%!
Professional people do professional things. Gbase participated in the compilation of the database development research report (2022) and was selected into the global database industry map
期货网上开户安全吗,怎么开户啊,需要多少钱?
【若依(ruoyi)】popover
为什么要引入线程?
sqlilabs less-27
The former backbone of WPS spent 10 years building new software. Excel users: I switched to WPS for this
c语言初学者对puts()的问题
A woman who didn't accept Shan Xiu when looking for a job was humiliated by HR: we're not looking for a junior
"Fundamentals of program design" Chapter 10 function and program structure 6-6 recursive implementation sequential output integer (15 points)
Leetcode中使用BFS解决二叉树相关题目的行动指南
SSM integrates annotation mapping and XML Mapping
支持向量机学习笔记(1)
线性回归模型学习笔记(1)