You cannot have a where statement. If you use a table, then you can.
INSERT INTO product (CategoriesId) values (2)
Or like this:
INSERT INTO product (CategoriesId)
SELECT CategoriesId
FROM someTable
WHERE someTable.Categories=' ab '
Or, if you have existing rows and want UPDATEthem. Then do the following:
UPDATE product SET CategoriesId=2 WHERE Categories='ab'
Arion source
share