a表里面有x,z两个字段 e有x,y两个字段,已知e.y,e.x=a.x得到a.z。b表有zuv三个字段,a.z=b.z,得到b.u,b.v,C表有u,i两个字段C.U=B.U得到C.I,D表有V,J两个字段,D.V=B.V,得到D.J已知E.Y,还有A的四个字段返回A的另外两个字段, C.I,D.J
我写的代码是:
select
c.prod_name prodName,
a.facetotalamt faceTotalamt,
a.repointamt repointAmt,
d.secname countSrc
form
rep_deal a left outer join glb_cntparty e on (a.custaccount = e.abbrname and e.partyname = #{cmbCounterid,jdbcType=VARCHAR})
rep_assfe b,
prd_baseinfo c,
src.secinfo d,
where
a.prodtype='N'
and a.effectflag = 'E'
and c.effectflag = 'E'
and d.effectfiag = 'E'
and a.vdate = to_date(#{vDate,jdbcType=VARCHAR},'YYYY/MM/DD')
and a.mdate = to_date(#{mDate,jdbcType=VARCHAR},'YYYY/MM/DD')
and a.reporate = #{repoRate,jdbcType=DECIMAL}
and a.ps = #{pS,jdbcType=VARCHAR}
and e.partyname = #{cmbCounterid,jdbcType=VARCHAR}
and a.custaccount = d.abbrname
and b.assetuuid = c.prodid
and b.assetuuid = d.secid
我写的代码是:
select
c.prod_name prodName,
a.facetotalamt faceTotalamt,
a.repointamt repointAmt,
d.secname countSrc
form
rep_deal a left outer join glb_cntparty e on (a.custaccount = e.abbrname and e.partyname = #{cmbCounterid,jdbcType=VARCHAR})
rep_assfe b,
prd_baseinfo c,
src.secinfo d,
where
a.prodtype='N'
and a.effectflag = 'E'
and c.effectflag = 'E'
and d.effectfiag = 'E'
and a.vdate = to_date(#{vDate,jdbcType=VARCHAR},'YYYY/MM/DD')
and a.mdate = to_date(#{mDate,jdbcType=VARCHAR},'YYYY/MM/DD')
and a.reporate = #{repoRate,jdbcType=DECIMAL}
and a.ps = #{pS,jdbcType=VARCHAR}
and e.partyname = #{cmbCounterid,jdbcType=VARCHAR}
and a.custaccount = d.abbrname
and b.assetuuid = c.prodid
and b.assetuuid = d.secid
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货