<分区>
数据库名称: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