MySQL將表a中查詢的數據插入到表b中_MySQL
來源:懂視網
責編:小采
時間:2020-11-09 19:44:47
MySQL將表a中查詢的數據插入到表b中_MySQL
MySQL將表a中查詢的數據插入到表b中_MySQL:MySQL將表a中查詢的數據插入到表b中 如果表b存在 insert into b select * from a; 如果表b不存在 create table b as select * from a; 擴展: 將b表中的某寫字段值插入到a表中 insert into a (userID,userName) sel
導讀MySQL將表a中查詢的數據插入到表b中_MySQL:MySQL將表a中查詢的數據插入到表b中 如果表b存在 insert into b select * from a; 如果表b不存在 create table b as select * from a; 擴展: 將b表中的某寫字段值插入到a表中 insert into a (userID,userName) sel

MySQL將表a中查詢的數據插入到表b中
如果表b存在
insert into b select * from a;
如果表b不存在
create table b as select * from a;
擴展:
將b表中的某寫字段值插入到a表中
insert into a (userID,userName) select b.userID,b.userName from tr_ajax_chat_messages;
將a表和b表userID相等的值保存到a表
update a set a.userName=(select b.userName from b where a.userID = b.userID);
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
MySQL將表a中查詢的數據插入到表b中_MySQL
MySQL將表a中查詢的數據插入到表b中_MySQL:MySQL將表a中查詢的數據插入到表b中 如果表b存在 insert into b select * from a; 如果表b不存在 create table b as select * from a; 擴展: 將b表中的某寫字段值插入到a表中 insert into a (userID,userName) sel