我想使用WITH
子句更新我的表。我在尝试:
UPDATE mytable
SET myfield = (
WITH sub AS (SELECT 18)
SELECT CASE WHEN (sub = 18) THEN 100 ELSE 0 END)
和
WITH sub AS (SELECT 18)
UPDATE mytable
SET myfield = (
SELECT CASE WHEN (sub = 18) THEN 100 ELSE 0 END)
但它不起作用。请向我解释我做错了什么。