0
我想使我的數量小於某個值的列。當我嘗試這一點,在查詢運行我們可以在select子句中使用關係運算符
select LOSA_APP.app_ref_no AS "App.Ref.No.",
LOSA_EXP_SUMM_Z.group_exp AS "Group Exposure Amount",
LOSA_EXP_SUMM_Z.group_exp - 25000 AS "Less than",
columns AS "some Name"
columns AS "some Name"
from
losa_app LOSA_APP
INNER JOIN
code_branch CODE_BRANCH
ON
LOSA_APP.attend_branch = CODE_BRANCH.branch_id
....
where
LOSA_APP.app_status in ('A','R')
and
....
or
(
'&&aplication' = 'Enhancement'
and
(
nvl(LOSA_APP.review_type, '-') IN ('Enhancement', 'Additional') and nvl(LOSA_APP.review_freq, '-') IN ('Enhancement', 'New')
)
);
但是,當我改變行LOSA_EXP_SUMM_Z.group_exp - 25000 AS "Less than"
到LOSA_EXP_SUMM_Z.group_exp < 25000 AS "Less than"
,然後我得到的錯誤
ORA-00923: FROM keyword not found where expected
00923. 00000 - "FROM keyword not found where expected"
*Cause:
*Action:
Error at Line: 3 Column: 34
線3是LOSA_EXP_SUMM_Z.group_exp < 25000 AS "Less than"
。爲什麼在我們使用subtract sign
時運行,並在relational operator
的情況下發生錯誤?
感謝