I have a 2 identical databases running on Oracle 12c. They are sitting on 2 different servers.
I'm executing the following query using SQL Developer on both databases.
select * from sla where objectname = 'INCIDENT' and status in 'ACTIVE' and (exists (select 1 from classancestor where ancestor=sla.classstructureid and classancestor.classstructureid= '') or classstructureid is null or classstructureid = '' ) ;
I get 260 results on one of the databases and 0 results on the other. This query is generated by an ERP we are using so I cannot modify the SQL itself.
One thing I noticed is that if I remove the parentheses surrounding the exists operator, the behaviour changes.
Can someone help? Is there a precedence when using OR? Is there an Oracle patch that has an impact on how SQL statements are processed?
Thanks