我正在尝试执行 case 语句,但出现错误。这是我的查询
select LOSA_APP.app_ref_no AS "App.Ref.No.", CODE_BRANCH.branch_name AS "BRANCH"
from losa_app LOSA_APP
INNER JOIN
losa_app_z LOSA_APP_Z
ON
losa_app.app_ref_no = losa_app_z.app_ref_no
INNER JOIN
code_branch CODE_BRANCH
ON
LOSA_APP.attend_branch = CODE_BRANCH.branch_id
where
LOSA_APP.app_status='A' -- Application Status in {‘accepted’}
and
trunc(sysdate) between (nvl(LOSA_APP_Z.li_dt, LOSA_APP_Z.li_collect_dt)) AND ((trunc(sysdate))) -- falling under the reporting period
and
(trunc(sysdate) - nvl(losa_app_z.li_dt,losa_app_z.li_collect_dt)) > 90 -- select application cases at any step after entering Documentation flows.
and
losa_app.product_type = 'MG' -- Select records based on input parameter value passed in.
and
case :input1
when 'ABB' Then code_branch.branch_code1 like '%0232%'
when 'AiBB' Then code_branch.branch_code1 like '%0347%'
end
在执行时它要求我输入。之后它给了我错误
ORA-00905: missing keyword
00905. 00000 - "missing keyword"
*Cause:
*Action:
Error at Line: 22 Column: 50
第 22 行是when 'ABB' Then code_branch.branch_code1 like '%0232%'
我缺少什么关键字?
谢谢