注册

带有exists子查询sql语句在oracle库中与dm库中查询结果不一致

极速的浪漫青春🇨🇳 2024/03/14 544 4

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DM8
【操作系统】:windows
【CPU】:
【问题描述】*:同一个带有exists子查询sql语句在oracle库中与dm库中查询结果不一致,DM库的数据是从ORACLE迁移来的。

sql语句如下:

select count(pk_voucher) from gl_voucher where discardflag!='Y' and pk_manager = 'N/A' and errmessage='~' and ( ( ( (exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_org=pub_sysinit.pk_org and initcode='GL003' and value='Y' and pk_checked != '~' ) ) or (not exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_org=pub_sysinit.pk_org and initcode='GL003' and value='Y' ) ) ) or ( (exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_accountingbook=pub_sysinit.pk_org and initcode='GL003'and value='Y' and pk_checked != '~' ) ) or (not exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_accountingbook=pub_sysinit.pk_org and initcode='GL003' and value='Y' ) ) ) ) and ( ( (exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_org=pub_sysinit.pk_org and initcode='GL001' and value='Y' and (signflag='Y' and (pk_casher != '~' or signflag<>'Y')) ) ) or (not exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_org=pub_sysinit.pk_org and initcode='GL001' and value='Y' ) ) ) or ( (exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_accountingbook=pub_sysinit.pk_org and initcode='GL001' and value='Y' and (signflag='Y' and (pk_casher != '~' or signflag<>'Y')) ) ) or (not exists ( select pk_sysinit from pub_sysinit where gl_voucher.pk_accountingbook=pub_sysinit.pk_org and initcode='GL001' and value='Y' ) ) ) ) ) and pk_voucher in ('1001A61000000007DUBY', '1001A61000000007DUGD', '1001A61000000007DUI4') and dr=0

在ORACLE中查询出正确的三条'1001A61000000007DUBY', '1001A61000000007DUGD', '1001A61000000007DUI4'
而在DM中查询出来的不止这三条

回答 0
暂无回答
扫一扫
联系客服