遇到的长SQL语句

目前工作中遇到的较长的SQL语句,记录一下,时常看看,其它短的就简单啦.


select id,
plat_date,
actiontype,
t9.codevalue,
submit_user,       
submit_date,       
feed_user,       
feed_date,    
t8.jgmc branch_name,
accountno,
t2.codevalue accountstat,
t3.codevalue amtype,
en_code,
en_name,
t4.codevalue account_type,
t5.codevalue account_cata,
t6.codevalue currency_code,
business_date,
file_number,
t7.codevalue limit_type,
account_limit,
actiondesc,
remark 

FROM T_FEDS_ACCOUNT t1,
t_feds_appcodeparam t2,
t_feds_appcodeparam t3,
t_feds_appcodeparam t4,
t_feds_appcodeparam t5,
t_feds_appcodeparam t6,
t_feds_appcodeparam t7,
t_base_bankinst     t8,
t_feds_appcodeparam t9

WHERE  
t1.accountstat= t2.codenumber
and t2.codetype = '14'
and t1.amtype= t3.codenumber
and t3.codetype = '13'
and t1.account_type= t4.codenumber
and t4.codetype = '15'
and t1.account_cata= t5.codenumber
and t5.codetype = '16'
and t1.currency_code= t6.codenumber
and t6.codetype = '17'
and t1.limit_type= t7.codenumber
and t7.codetype = '12'
and t1.branch_code = t8.jgbh
and t1.submit_id = t9.codenumber
and t9.codetype = '97'
and t1.plat_date like '{$param1}' and (t1.branch_code ='{$param2}' or  t1.branch_code in (select jgbh from t_base_bankinst  where sjjg='{$param2}')) 
order by plat_date desc,plat_time desc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值