gpt4 book ai didi

mysql从多个选择查询插入表

转载 作者:行者123 更新时间:2023-11-29 11:45:55 25 4
gpt4 key购买 nike

我如何将其合并到一个插入中

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))

关于mysql从多个选择查询插入表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34951705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com