日期:2014-05-18  浏览次数:20554 次

.net应用程序查询结果与 pl/sql 查询结果不一致
有没有高手遇到过通过.net应用程序查询结果与 pl/sql 查询结果不一致的情况?
.net中得到的结果中有重复记录,而且记录不全。我将调试中得到的sql语句在pl/sql中执行,结果是我想要的。不知道不一致的原因出在哪
我的sql语句:
select xx.*, x1.*
  from (select o.bankname, o.bankid, x0.*
  from (select bankname, bankid
  from b_f_dh_jigou r
  where r.bankid != '620000000'
  and r.bankid != '620400000') o
  left join (select substr(b.jigou, 0, 5) as jigou,
  sum(a.REPAYMENT_AMT * (CASE
  WHEN c1.DISCOUNT_RATE_OF_RMB IS NULL THEN
  1
  ELSE
  c1.DISCOUNT_RATE_OF_RMB / 100
  end)) as SUM_HKHS
  from odsbdata.BF_AGT_LNE_CONTRACT_REPAY_PLAN a
  inner join b_f_dh_loans b on a.contract_num =
  b.contract_num
  left join (select b1.CM_CURR_COD,
  b1.DISCOUNT_RATE_OF_RMB
  from odsbdata.BF_CM_CD_CLPM_EXCHANGE_RATE b1
  where b1.discount_dt =
  (SELECT to_char(MAX(CLPM_DATE),
  'YYYY-MM-DD')
  FROM b_f_dh_sn_xqy_fun1)) c1 on (b.CURR_CD =
  c1.CM_CURR_COD)
  where 1 = 1
  AND a.REPAY_DATE between ('2011-06-08') and
  ('2011-07-08')
  and LOAN_STATUS_CD in ('02', '03', '04')
  group by substr(b.jigou, 0, 5)) x0 on substr(o.bankid,
  0,
  5) =
  x0.jigou) xx
  left join (select substr(b.jigou, 0, 5) as jigou1,
  sum(b.BALANCE_INNER_SHEET * (CASE
  WHEN c1.DISCOUNT_RATE_OF_RMB IS NULL THEN
  1
  ELSE
  c1.DISCOUNT_RATE_OF_RMB / 100
  end)) as SUM_DQHS
  from b_f_dh_loans b
  left join (select b1.CM_CURR_COD, b1.DISCOUNT_RATE_OF_RMB
  from odsbdata.BF_CM_CD_CLPM_EXCHANGE_RATE b1
  where b1.discount_dt =
  (SELECT to_char(MAX(CLPM_DATE), 'YYYY-MM-DD')
  FROM b_f_dh_sn_xqy_fun1)) c1 on (b.CURR_CD =
  c1.CM_CURR_COD)
  where 1 = 1
  AND b.expiring_dt between ('2011-06-08') and ('2011-07-08')
  and LOAN_STATUS_CD in ('02', '03', '04')
  group by substr(b.jigou, 0, 5)) x1 on substr(xx.bankid, 0, 5) =
  x1.jigou1


------解决方案--------------------
.net中得到的结果中有重复记录

是绑定后看到有重复记录还是返回的table中就有重复记录?
------解决方案--------------------
你取出来的数据返回的是什么东西。

绑定在什么控件上。
------解决方案--------------------