错误说“错误代码:1242。子查询返回多于1行”

时间:2019-04-18 07:25:17

标签: mysql

我正在尝试插入表格,这是我的第三对多对多表格,称为“许可证”。 我已经将插入语句写到存储过程中。

我要插入客户和产品表的主键,它们的ID是第三张表许可证的外键,我写了如下插入语句:

insert into customer`.`tbl_license`(LicenseKey,Quantity,CustomerId,ProductId,Discount) 
                    values((select UUID()),quantity,
(select AutoID from customer.tbl_customer where 
CustomerName=customername),
(select AutoID from customer.tbl_product where 
ProductName=productname),discount);

此插入语句正确吗? 我已经在插入语句中编写了查询

0 个答案:

没有答案
相关问题