我有一个查询,其中减去两个日期,但出现错误。这是查询
select LOSA_APP.app_ref_no AS "App.Ref.No.",
CODE_BRANCH.branch_name AS "Business Unit",
...,
:endDate - LOSA_APP_Z.li_dt AS "Day Count",.
...
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='A'; -- Application Status in {‘accepted’}
但我收到错误
ORA-00932: inconsistent datatypes: expected CHAR got DATE
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
我做错了什么?