我正在运行这样的查询,但收到错误
insert into oc_product_to_category (product_id, category_id) values (select product_id from oc_product where model='Schar Gluten & Wheat Free Classic White Bread, 14.1 oz (Pack ' and price=36.26 limit 1, select category_id from oc_category_description where name='Bakery & Bread');
我做错了什么?
答案 0 :(得分:0)
values
insert . . . select
insert into oc_product_to_category (product_id, category_id)
select (select product_id
from oc_product
where model = 'Schar Gluten & Wheat Free Classic White Bread, 14.1 oz (Pack ' and
price = 36.26
limit 1
),
(select category_id
from oc_category_description
where name='Bakery & Bread'
);
但是,您的问题可能是第二个子查询未被括号括起来。