Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

环境变量识别报错 #46

Closed
AndyZjy opened this issue Sep 2, 2021 · 0 comments
Closed

环境变量识别报错 #46

AndyZjy opened this issue Sep 2, 2021 · 0 comments
Assignees

Comments

@AndyZjy
Copy link
Member

AndyZjy commented Sep 2, 2021

详情

环境变量在 SQL 中识别时,会报如图的错误

image

SQL如下:

create table fen_hao_split
    as
    select '202107' as ${tmonth_code},t.project_code,d.ac_code,
    d.disp_code,d.disp_index,
    sum(case when d.isdecr is not null and d.isdecr<>t.isdecr then 0 else m_scale*t.rmb_value end) as ttl_value,
    sum(case when date_format(date_code,'yyyyMM')<concat(substr('202107',1,4),'01') and d.isdecr is not null and d.isdecr<>t.isdecr then 0
            when date_format(date_code,'yyyyMM')<concat(substr('202107',1,4),'01') then m_scale*t.rmb_value end) as jan_value 
    from ods_d_pfa_gl_account_df d 
    left join tmp_ads_fin_pfa_balance_proj_df_00_rt t 
    on substr(t.account_code,1,4) = d.fin_account_code 
    or substr(t.account_code,1,6) = d.fin_account_code 
        or substr(t.account_code,1,8) = d.fin_account_code 
    or substr(t.account_code,1,4)=split(fin_account_code,';')[0]
    where table_type='资产负债表'  and d.year_code=substr('202107',1,4)  and fiscal_period<='202107'
    group by t.project_code,d.ac_code,
            d.disp_code,d.disp_index
    limit 10
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants