语法错误在或附近" as"

时间:2017-01-11 13:54:20

标签: sql postgresql

这是我遇到的错误: 语法错误在" as"

CASE WHEN ver_desc_txt = 'BEST OFFICIAL PROJECTION' THEN round(sum(d.spcl_prc_grs_sls_amt::double precision / f.exch_rate)::numeric, 2) as BOP_gr_sales_dol

不太明白为什么。所以需要你的帮助

1 个答案:

答案 0 :(得分:2)

您似乎错过了END语句的CASE部分。

CASE WHEN ver_desc_txt = 'BEST OFFICIAL PROJECTION' THEN 
round(sum(d.spcl_prc_grs_sls_amt::double precision / f.exch_rate)::numeric, 2) as BOP_gr_sales_dol

应该......

CASE WHEN ver_desc_txt = 'BEST OFFICIAL PROJECTION' THEN 
round(sum(d.spcl_prc_grs_sls_amt::double precision / f.exch_rate)::numeric, 2) END as BOP_gr_sales_dol