繁体   English   中英

MySQL从多个选择查询插入表

[英]mysql insert into table from multiple select queries

我如何将其组合成单个插入物

INSERT INTO masterTable (count1) select count(*) as count1 from tablex
INSERT INTO masterTable (count2) select count(*) as count2 from tabley
INSERT INTO masterTable (count3) select count(*) as count3 from tablez
INSERT INTO MasterTable (count1,count2,count3) 
VALUES ((select count(*) from tablex),(select count(*) from tabley),(select count(*) from tablez))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM