gpt4 book ai didi

mysql - 这个查询有什么问题?

转载 作者:太空宇宙 更新时间:2023-11-03 11:16:25 25 4
gpt4 key购买 nike

INSERT INTO print_development.categories (id, name)
VALUES (select id, name from print_pro.categories where parent_id is NULL);

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select id, name from print_pro.categories where parent_id is NULL)' at line 2

最佳答案

您的 INSERT/SELECT 语法错误。您不使用“VALUES”,只需使用 SELECT。

INSERT INTO print_development.categories (id, name)
select id, name from print_pro.categories where parent_id is NULL

http://dev.mysql.com/doc/refman/5.5/en/insert.html

关于mysql - 这个查询有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4709723/

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