gpt4 book ai didi

Mysql错误: 1222 when I am creating a new table from two existing tables

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

当我从两个现有表创建新表时,Mysql 错误:1222。这是我的 sql 语句,用于从两个现有表创建一个新表。请帮我找到这个问题的解决方案,谢谢

CREATE TABLE insurance_db.new_insurance 
SELECT * FROM insurance_db.auto_insurance
UNION all
SELECT * FROM insurance_db.home_insurance;

最佳答案

试试这个方法

CREATE TABLE insurance_db.new_insurance 
As (SELECT col1, col2,.... FROM insurance_db.auto_insurance, insurance_db.home_insurance);

关于Mysql错误: 1222 when I am creating a new table from two existing tables,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25480259/

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