select * from fsd1.ta13_loan_balance t where t.data_date='2014-11-30'
and t.bank_id like 'GTRF%' and t.validate_status<>'3';
substr(t.loan_iou_code,1,length(loan_iou_code)-4)

update fsd1.ta13_loan_balance t set t.int_rate_is_fixed = (select
case when rate_type = 'S' then
'RF01'
else
'RF02'
end as int_rate_is_fixed from tmp_fsd_GTRF_LOAN a
where a.lending_ref = substr(t.loan_iou_code,1,length(loan_iou_code)-4)
)
where t.data_date='2014-11-30'
and t.bank_id like 'GTRF%' and t.validate_status<>'3';