为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【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中查询出来的不止这三条
建议构造一个可重现的例子发出来,包含建表语句,插入数据的语句和查询结果不一致的语句
要不先对比一下迁移前后的数据量,和数据一致不
你可以看一下你数据库的大小写敏感这个参数,如果你是大小写不敏感的,你字母是小写的也会查出来,如1001A61000000007duby