Use the select statement, the concat function to export the insert script of the table

---sql
select concat('insert into user(user_id,user_name,pswd) values(','''',user_id,''',','''',user_name,''',','''',pswd,'''',');') from user;

---result

| insert into user(user_id,user_name,pswd) values('haiyoung','Haiyoung','123');                                          
| insert into user(user_id,user_name,pswd) values('haiyoung001','Haiyoung001','123');                                    
| insert into user(user_id,user_name,pswd) values('haiyoung002','Haiyoung002','123');                                    
| insert into user(user_id,user_name,pswd) values('haiyoung003','Haiyoung003','123');

The execution result is shown in the figure:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325422700&siteId=291194637
Recommended