OK、これは構文が修正された挿入クエリです
INSERT INTO MyTable (value1, value2)
SELECT t.name,
CASE WHEN t.name IN ('MyName') THEN 1
ELSE 2
END AS value2
FROM MyTable;
既存の行を変更しようとしている場合は、更新クエリが必要です。例:
-- first update, set value1 to 1 and value2 for all rows
UPDATE MyTable set value1 = 1,value2 = 2;
-- next query. Set value2 = 1 for only those rows matching your criteria
UPDATE MyTable
SET value2 = 1 WHERE name IN ('MyName');