此查询出了什么问题?
SELECT *,
CASE
WHEN Step=6 THEN "#SQ1_1" END,
WHEN Step= 12 THEN "#SQ1_2"
ELSE Col_A
END AS "Layers"
FROM my_table
答案 0 :(得分:1)
第三行中的END,
似乎有点过多。正确的格式化代码有很大帮助。
只需尝试:
SELECT *
,CASE WHEN Step = 6
THEN "#SQ1_1"
WHEN Step = 12
THEN "#SQ1_2"
ELSE Col_A
END AS "Layers"
FROM my_table