SELECT query with an aggregate function could return the wrong result when the CASE condition was on different columns (Doc ID 1684529.1)

Last updated on JANUARY 24, 2016

Applies to:

Oracle Exalytics Software - Version 1.0.0.0.0 to 1.0.0.3.0 [Release 1.0]
Oracle TimesTen In-Memory Database - Version 11.2.2.6.5 to 11.2.2.7.1 [Release 11.2]
Information in this document applies to any platform.

Symptoms

 A problem is fixed where a SELECT query with an aggregate function could return the wrong result when the CASE condition was on different columns.  This was seen in a query generated by OBIEE for Exalytics system.  Note below is the query as seen by TimesTen, and the aggregate here is SUM.

Example:

 select   
 sum(case  when T1.H4 = 'FUTURE_BENEFITS' then 
T3.AMT end ) 
+ sum(case  when T1.H4 = 'BAL' then 
T3.AMT end ) as c1, 
sum(case  when T1.H2 = 'ASSETS' then 
T3.AMT end ) as c2, 
sum(case  when T1.H2 = 'LIABILITIES' then 
T3.AMT end ) as c3 
 from 

.... 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms