select
a.APP_ID,a.APPLICATION_DATE,e.AMOUNT_FINANCE,a.STATUS_FK,d.DESCRIPTION,a.LAST_MODIFIED_DATE,b.COMPANY_NAME,b.BR_NUMBER,c.NUM_OF_EMPLOYEE,c.ANNUAL_SALES_TURNOVER,
b.BASIC_GROUP_CODE_DESC,b.PROFILE_CORP_TYPE_DESC,c.BUMIPUTERA,c.BNM_SECTORAL_CODE,b.CORPORATE_STATUS,c.SMALL_MEDIUM_ENT,b.PRIORITY_SECTOR,b.DATE_OF_REG,
e.ORIGINAL_FINANCING_TERMS, f.REJECTION_DATE, f.APPROVAL_DATE, a.variable_rate_type, a.DEALER_NAME, g.REG_NUMBER, (select pick_up_by_id from EHP_ESCALATION_RESULT, EHP_LOAN_APP where STATUS_ID in(5,12,15,18,21,24)) as "Reject_By_Id", (select pick_up_by_id from EHP_ESCALATION_RESULT, EHP_LOAN_APP where STATUS_ID in(4)) as "Approve_By_Id",
(select min(PICKUP_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 93) as "Manager_pick_up_date", (select min(ESCALATION_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 93) as "Manager_escalation_date", (select min(PICKUP_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 148) as "Manager_CUD_pick_up_date", (select min(PICKUP_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 149) as "Head_CUD_pick_up_date", (select min(ESCALATION_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 149) as "Head_CUD_escalation_date", (select min(PICKUP_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 150) as "HAF_pick_up_date", (select min(PICKUP_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 94) as "underwriter_pick_up_date", (select min(ESCALATION_DATE) from EHP_ESCALATION_RESULT es, EHP_LOAN_APP a where es.LOAN_APP_FK=a.ID and permission_id = 94) as "underwriter_escalation_date", g.VEHICLE_KEPT,
from
EHP_LOAN_APP a,
EHP_COMPANY b,
EHP_ADD_DETAILS c,
EHP_STATUS d,
EHP_FINANCE e,
EHP_ESCALATION_RESULT f,
EHP_VEHICLE g
where
a.LAST_MODIFIED_DATE >= '1 July 2016 00:00:00' and a.APPLICATION_DATE <= '31 July 2016 23:59:59'
and b.LOAN_APP_FK = a.ID
and c.LOAN_APP_ID = a.ID
and d.ID = a.STATUS_FK
and e.LOAN_APP_FK = a.ID
and f.LOAN_APP_FK = a.ID
and g.LOAN_APP_FK = a.ID
这是我开发的查询。运行后,我收到以下错误:
错误:EHP_VEHICLE&#39;
附近的语法不正确SQLState:42000 错误码:102
我不知道导致此错误的原因。我将不胜感激任何帮助或线索。
更新:2016年11月18日
我添加了丢失的逗号,但我收到了另一个错误:
SQLState: ZZZZZ
ErrorCode: 156
Error:Incorrect syntax near the keyword 'as'.
SQLState: ZZZZZ
ErrorCode: 156
Error:Incorrect syntax near the keyword 'as'.
SQLState: ZZZZZ
ErrorCode: 156
Error:Incorrect syntax near the keyword 'as'.
SQLState: ZZZZZ
ErrorCode: 156
Error:Incorrect syntax near the keyword 'as'.
答案 0 :(得分:0)
你在f
后失踪了EHP_FINANCE e,
EHP_ESCALATION_RESULT f
EHP_VEHICLE g
P.S。 你熟悉ANSI JOINS吗?