【发布时间】:2013-12-19 07:47:21
【问题描述】:
我有这个代码的错误
ORA-00907:缺少右括号
select buyer
,cobuyer
, case
when Sp_Desc like('ma%') then 'mail'
when Sp_Desc like('pa%') then 'phone'
else " "
end AS Special_Handling
from
( string_function(g.buyer_id)
from gift g ) AS Sp_Desc
, salary
, etc
【问题讨论】:
-
不清楚您认为
buyer、cobuyer、salary等列的来源。您不能使用AS作为表别名。此外," "无效 - 可能应该是' '。 -
买家和共同买家只是选择语句,我补充说,该案例处于几个选择语句的中间。我试图完成的是 1: Generate Sp_Desc in this statement: string_function(g.buyer_id) AS Sp_Desc 并在 case 语句中使用它来在这个语句中创建 Special_Handling 列: , case when Sp_Desc like('ma%')然后 'mail' 当 Sp_Desc like('pa%') 然后 'phone' else ' ' end AS Special_Handling 希望你能帮助我。
标签: oracle