【发布时间】:2017-06-01 15:23:43
【问题描述】:
请在下面查看我的查询,
insert into dbo.orderDetails(orderNo,clientId,productId,quantity)
values(' ee941422-5546-4d62-b5d6-60ecd13ca2b8 ')
select client_id,product_id,amount from dbo.cart
where client_id =' efc08f7c-fdfc-4712-9488-fc1c55acb95e ' ;
在这我想要一个静态的订单号,其余的应该来自一个表(dbo.cart)。当我执行我的查询时,它会显示这个错误
There are more columns in the INSERT statement than values specified in the
VALUES clause. The number of values in the VALUES clause must match the
number of columns specified in the INSERT statement.
任何解决方案。
【问题讨论】:
-
您确定您使用的是 MySQL 吗?
dbo通常是 SQL-Server。 -
VALUES()中的列数需要与要插入的表中的列数相匹配。
标签: mysql