oracle同样的数据执行的结果不同
sql 如下
sum(t1),sum(t2),sum(t3),users from ( select case when state='0' then 1 end as t1,case when state!='0' then 1 end as t2 ,case when state='0' then 0 else to_number(price) end as t3 ,(select attributionc_id from agency where accountno=substr(insurancebaseinfo.auditsale,0,8) ) users from insurancebaseinfo WHERE 1=1 and auditsaledate<='2013-05-27 24:00:00' and auditsaledate>='2012-04-29 00:00:00' ) A where
users in (select accountno from adminusers where isassociation='3'and description='57HYX') group by users
我本地结果是
sum(t1) sum(t2) sum(t3) users
----------------------------------------------------
775 15248 304960 ZJDLN
服务器上的结果是
sum(t1) sum(t2) sum(t3) users
----------------------------------------------------
14780 177853 355760
775 15248 304960 ZJDLN
然后我改掉sql
sum(t1),sum(t2),sum(t3),users from ( select case when state='0' then 1 end as t1,case when state!='0' then 1 end as t2 ,case when state='0' then 0 else to_number(price) end as t3 ,(select attributionc_id from agency where accountno=substr(insurancebaseinfo.auditsale,0,8) ) users from insurancebaseinfo WHERE 1=1 and auditsaledate<='2013-05-27 24:00:00' and auditsaledate>='2012-04-29 00:00:00' ) A where user is not null and users in (select accountno from adminusers where isassociation='3'and description='57HYX') group by users
我本地结果是
sum(t1) sum(t2) sum(t3) users
----------------------------------------------------
775 15248 304960 ZJDLN
服务器上的结果是
sum(t1) sum(t2) sum(t3) users
----------------------------------------------------
14780 177853 355760
775 15248 304960 ZJDLN
结果依旧没变