gpt4 book ai didi

mysql - 无法使用名为 'order' 的表执行插入查询?

转载 作者:太空宇宙 更新时间:2023-11-03 10:58:41 24 4
gpt4 key购买 nike

<分区>

数据库名称:test表名:order, order_shipping,order_payment

下面的查询给我错误

INSERT INTO order(order_status,customer_id) values('booked',1) 

error : 1064 - 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 'order(order_status,customer_id) values('booked',1)' at line 1

但是如果我在表名之前添加数据库名,则完全相同的查询将起作用

INSERT INTO test.order(order_status,customer_id) values('booked',1) 

result : insertion successfull

我将表名“order”重命名为“order_main”,它可以在没有数据库名称的情况下工作

INSERT INTO order_main(order_status,customer_id) values('booked',1) 

insertion successfull

我的问题是,如果没有数据库名称附加到表名称,为什么我的原始查询不起作用。是不是因为我还有其他表以这个表名开头???

我的数据库中的表:order, order_shipping,order_payment

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