gpt4 book ai didi

sql - hive 查询中 “”缺少EOF “”

转载 作者:行者123 更新时间:2023-12-02 10:55:47 29 4
gpt4 key购买 nike

我可以得到帮助...我真的是SQL的新手,而这段代码是我以前的助手的遗产。
我正在使用配置单元查询,但在53:65行遇到了缺少EOF的问题
这是代码:

SELECT
'24-08-20' AS AS_OF_DATE,
'KRK' AS Flag,
B.COD_LOB AS LOB_CODE,
A.COD_CUST AS CIF_KEY,
A.NAM_CUST_SHRT AS CUST_NAME,
CAST (A.COD_ACCT_NO AS CHAR(12)) as ACCOUNT_NUMBER,
' ' AS CONTRACT_REF_NO,
-------A.COD_CCY AS CCY,
CASE A.COD_CCY WHEN 36 THEN 'AUD' WHEN 124 THEN 'CAD' WHEN 344 THEN 'HKD' WHEN 356 THEN 'INR' WHEN 360 THEN 'IDR'
WHEN 392 THEN 'JPY' WHEN 458 THEN 'MYR' WHEN 554 THEN 'NZD' WHEN 578 THEN 'NOK' WHEN 702 THEN 'SGD' WHEN 752 THEN 'SEK'
WHEN 756 THEN 'CHF' WHEN 764 THEN 'THB' WHEN 826 THEN 'GBP' WHEN 978 THEN 'EUR' WHEN 840 THEN 'USD' ELSE 'OTHER' END CCY,
cast (A.COD_PROD as char(10)) AS PRODUCT_CODE_NCBS,
cast (A.COD_PROD as char(10)) AS PROD_ICBS,
D.NAM_PRODUCT as PRODUCT_DESC,
L.RAT_INT AS CUR_NET_RATE,
INT_VAR.RAT_VARIANCE AS RAT_VARIANCE,
'NULL' AS INDEX_RATE,
(CASE WHEN(INT_VAR.RAT_VARIANCE) IS NULL THEN L.RAT_INT ELSE (L.RAT_INT + INT_VAR.RAT_VARIANCE)END) AS NET_INTEREST,
rtrim(convert (DAT_ACCT_OPEN,111)) AS ACCOUNT_OPEN_DATE,
rtrim(convert(LINE_START_DATE,111)) AS ROLLOVER_DATE,
rtrim(convert(LINE_EXPIRY_DATE,111))AS MATURITY_DATE,
CAST (COD_ACCT_STAT AS CHAR(3)) AS ACCOUNT_STATUS,
rtrim(convert(LINE_EXPIRY_DATE,111))AS ACCOUNT_CLOSE_DATE,
B.COD_AO_BUSINESS AS AO_BUSINESS,
A.COD_CC_BRN AS BRANCH_CD,
C.cod_brn_type AS BRANCH_REGIONAL,
C.nam_branch AS BRANCH_DESCRIPTION,
(A.BAL_BOOK*-1) AS BALANCE_ORI,
case when i.nam_ccy_short = 'IDR' and H.COD_CRR_TO>20 then (a.BAL_BOOK*-1)-tunggak.BUNGA_TUNGGAK else
case when i.nam_ccy_short <> 'IDR' and H.COD_CRR_TO>20 then (a.BAL_BOOK*j.revrate*-1)-tunggak.BUNGA_TUNGGAK else
case when i.nam_ccy_short = 'IDR' and H.COD_CRR_TO<=20 then (a.BAL_BOOK*-1) else (a.BAL_BOOK*j.revrate*-1) end end end as BALANCE_IDR,
A.COD_LINE_NO AS CREDIT_LINE_ID,
G.RECORD_STAT AS LINE_STATUS,
M.dat_limit_start AS DATE_DISB,
G.LIMIT_AMOUNT AS LIMIT_PLAFON_ORI,
case when i.nam_ccy_short = 'IDR' then (G.LIMIT_AMOUNT) else (G.LIMIT_AMOUNT*j.revrate) end as LIMIT_PLAFON_IDR,
H.COD_CRR_TO AS COLL,
'FCR-KRK-NCBS' AS SOURCE_DATA
-----------------------------------------
FROM (Select COD_CUST, NAM_CUST_SHRT,COD_ACCT_NO,COD_CCY,COD_PROD,COD_ACCT_STAT,COD_CC_BRN,BAL_BOOK,COD_LINE_NO,DAT_ACCT_OPEN from newmisplus2.BD_MIS_CH_ACCT_MAST where date_pr='20200824') A INNER JOIN (SELECT COD_PROD,COD_CCY,FLG_USE_TIERED_RATES_FOR_OD from newmisplus2.BD_CH_PROD_MAST WHERE COD_TYP_PROD='A' AND date_pr='20200824' ) X ON A.COD_PROD=X.COD_PROD AND A.COD_CCY=X.COD_CCY

LEFT JOIN (SELECT RAT_INT,COD_PROD from newmisplus2.BD_CH_INT_TAB WHERE COD_INT_TYPE='DR' AND date_pr='20200824') OD_DR ON A.COD_PROD=OD_DR.COD_PROD

LEFT JOIN (SELECT RAT_INT,COD_PROD from newmisplus2.BD_CH_INT_TAB WHERE COD_INT_TYPE='OL' AND date_pr='20200824') OD_OL ON A.COD_PROD=OD_OL.COD_PROD

LEFT JOIN (SELECT RAT_VARIANCE,COD_ACCT_NO from newmisplus2.BD_MIS_CH_ACCT_CUR_VARIANCE WHERE COD_INT_TYPE = 'DR' AND date_pr='20200824') INT_VAR
ON A.COD_ACCT_NO=INT_VAR.COD_ACCT_NO

LEFT JOIN
(SELECT A.COD_LIMIT_NO,AMT_LIMIT,RAT_INT_EFFECTIVE,A.COD_ACCT_NO from newmisplus2.BD_CH_OD_LIMIT where date_pr='20200824') A
INNER JOIN (SELECT COD_ACCT_NO,MAX(COD_LIMIT_NO) AS COD_LIMIT_NO from newmisplus2.BD_CH_OD_LIMIT where date_pr='20200824' GROUP BY COD_ACCT_NO) B
ON A.COD_ACCT_NO=B.COD_ACCT_NO AND A.COD_LIMIT_NO=B.COD_LIMIT_NO OD_INT_EFF ON A.COD_ACCT_NO=OD_INT_EFF.COD_ACCT_NO
-----------------------------------------
有什么建议可以解决该脚本吗?之前感谢

最佳答案

也许还有更多问题。我发现了什么:

LEFT JOIN
(SELECT A.COD_LIMIT_NO,AMT_LIMIT,RAT_INT_EFFECTIVE,A.COD_ACCT_NO from newmisplus2.BD_CH_OD_LIMIT where date_pr='20200824') A
INNER JOIN (SELECT COD_ACCT_NO,MAX(COD_LIMIT_NO) AS COD_LIMIT_NO from newmisplus2.BD_CH_OD_LIMIT where date_pr='20200824' GROUP BY COD_ACCT_NO) B
ON A.COD_ACCT_NO=B.COD_ACCT_NO AND A.COD_LIMIT_NO=B.COD_LIMIT_NO OD_INT_EFF ON A.COD_ACCT_NO=OD_INT_EFF.COD_ACCT_NO
A子查询与FROM之后的第一个子查询具有相同的名称A,并且它没有ON条件

关于sql - hive 查询中 “”缺少EOF “”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64495529/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com