返回语法错误的MySQL查询

返回语法错误的MySQL查询,mysql,select,insert,Mysql,Select,Insert,我正在运行一个类似这样的查询,但是得到了一个错误 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_i

我正在运行一个类似这样的查询,但是得到了一个错误

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');

我做错了什么?

您不需要插入
值的
。选择

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'
           );
但是,您的问题可能是第二个子查询没有用括号括起来