select 
inst_pt.inst_pt_key INST_PT_KEY,
acc.src_id ACC_NUM,
prod_inst.SRC_SYS_ID PRODUKT,
pos.src_id POS_ID,
acc.block1_code CONTR_BLOCK_CODE_1,
acc.block2_code CONTR_BLOCK_CODE_2,
acc.EMPL_FLAG EMP_FLAG,
card_inst.src_id CARD_NUM,
card_tp.src_id CARD_VARIANT,
COBRAND_TP.src_id CARD_COBRAND,
brand_tp.src_id CARD_BRAND,
DESIGN_CARD_TP.src_id DESIGN_CARD_TP_ID,
card_inst.LMT_ATM_AMT AUTH_LMT_AMT_ATM,
card_inst.LMT_POS_AMT AUTH_LMT_AMT_POS,
card_inst.EXPR_DATE EXPR_DATE,
card_inst.LMT_TP_ID LMT_TYPE,
card_inst.BLOCK_CODE CARD_BLOCK_CODE,
card_inst.BLOCK_date CARD_BLOCK_DATE,
CARD_CHIP_TP.src_id CARD_TECHNOLOGY,
card_inst.OTC_LMT AUTH_LMT_AMT_OTC,
facility_inst.LMT_AMT FACILITY_LMT_AMT,
sys_prod_tp.src_id SYS_PROD_TP_ID,
prod_inst.CONTR_NUM CONTR_NUM,
prod_inst.SIGN_DATE SIGN_DATE,
CARD_PCT.src_id CARD_PCT_ID,
VAR_PROD_TP.src_id VAR_PROD_TP_ID,
card_inst.OWNR_FLAG SUPLEMENTARY_CARD_FLAG,
ccy.src_id CURR_ID,
acc_stat.src_id ACC_STAT


from ods_l1_owner.inst_pt
left join ods_l1_owner.acc on acc.inst_pt_key = inst_pt.inst_pt_key
left join ods_l1_owner.acc_role on acc_role.acc_key = acc.acc_key
left join ods_l1_owner.prod_inst on prod_inst.prod_inst_key = acc_role.prod_inst_key 
left join ods_l1_owner.pos on pos.pos_key = prod_inst.orig_pos_key
left join ods_l1_owner.card_inst on card_inst.prod_inst_key = prod_inst.prod_inst_key
left join ods_l1_owner.card_tp on card_tp.card_tp_key = card_inst.card_tp_key
left join ods_l1_owner.COBRAND_TP on COBRAND_TP.COBRAND_TP_KEY = card_inst.COBRAND_TP_KEY
left join ods_l1_owner.brand_tp on brand_tp.brand_tp_key = card_inst.brand_tp_key
left join ods_l1_owner.DESIGN_CARD_TP on DESIGN_CARD_TP.DESIGN_CARD_TP_key = card_inst.DESIGN_CARD_TP_key
left join ods_l1_owner.CARD_CHIP_TP on CARD_CHIP_TP.CARD_CHIP_TP_KEY = card_inst.CARD_CHIP_TP_KEY
left join ods_l1_owner.facility_inst on facility_inst.prod_inst_key = prod_inst.prod_inst_key
left join ods_l1_owner.sys_prod_tp on sys_prod_tp.sys_prod_tp_key = prod_inst.sys_prod_tp_key
left join ods_l1_owner.CARD_PCT on card_pct.card_pct_key = prod_inst.CARD_PCT_KEY
left join ods_l1_owner.VAR_PROD_TP on VAR_PROD_TP.VAR_PROD_TP_key = prod_inst.SALES_VAR_PROD_TP_KEY
left join ods_l1_owner.CCY on ccy.ccy_key = acc.ccy_key 
left join ods_l1_owner.acc_stat on acc_stat.acc_stat_key = acc.acc_stat_key 
where ods_l1_owner.inst_pt.rc_num = '#rc_num'