0
より少ない項目が含まれているため、私は、静的あるOrderNoをしたい、残りはテーブル(dbo.cart)から来るべきで、以下の本でSQLのヘルプ|選択リストINSERT文がINSERTリスト
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 ' ;
を私のクエリを参照してください。 。私は私のクエリを実行すると、このエラーを示します。
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です。 – Barmar
'VALUES()'の列数は、挿入するテーブルの列数と一致する必要があります。 – ollie