本文主要是介绍SQL练习_1,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
select invest.id,(select t.cr_customer_number
from crm_customer@dl.crm t
where t.id = invest.customer_id) || '-' || invest.lending_no as 出借编号,
(select NODE_NAME
from FT_T_FLOW_DEF c
where invest.flow_id = c.node_code) as 流程ID,
(select data_name
from sys_t_dictionary b
where invest.product_type = b.data_code) as 理财产品,
(select sum(trunc(f.debt_proportion * l.amount_spare, 2))
from ac_t_ledger_loan@dl.core l, ac_t_ledger_finance@dl.core f
where l.id = f.loan_id
and f.acct_status in (1, 3, 4)
and l.acct_status in (1, 3, 4)
and f.ledger_id in
(select t.id
from ac_t_ledger@dl.core t
where t.account in (select t1.acc_id
from ft_t_invest_info t1
where t1.id = invest.id))) as pv,
invest.invest_amt as 投资金额
from ft_t_invest_info invest
where customer_id = 111;
这篇关于SQL练习_1的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!