当'products'表中满足条件时,我试图在表'products_to_categories'中插入关系(master_categories_id = 500)我的猜测是因为我的SELECT语句应该是JOIN?
table: products_to_categories
columns: products_id, categories_id
table: products
columns: products_id, master_categories_id
INSERT INTO products_to_categories (products_id, categories_id)
SELECT products.products_id, 500 FROM products
WHERE products.master_categories_id=500 HAVING count(categories_id) < 1;
返回错误:categories_id is an invalid column