【发布时间】:2018-10-04 14:22:59
【问题描述】:
我似乎找不到 vertica case when 语法的文档。 有人可以帮忙吗,
case when S.name = 'Stack' then E.Price end case when M.Type = 'Pricing' then V.value * V.Rate end as "Price"
我收到语法错误。
【问题讨论】:
标签: sql syntax syntax-error case vertica
我似乎找不到 vertica case when 语法的文档。 有人可以帮忙吗,
case when S.name = 'Stack' then E.Price end case when M.Type = 'Pricing' then V.value * V.Rate end as "Price"
我收到语法错误。
【问题讨论】:
标签: sql syntax syntax-error case vertica
开头只有一个case,结尾只有一个end,它们之间还有一系列when-thens:
CASE WHEN S.name = 'Stack' THEN E.Price
WHEN M.Type = 'Pricing' THEN V.value * V.Rate
END AS "Price"
【讨论】:
null 的价值是什么?你想用它们做什么?
这里是一个如何使用“case”的例子
case
when S.name = 'Stack' then E.Price
when M.Type = 'Pricing' then V.value * V.Rate
end as Price
【讨论】: