Wrong Results on select using UNION ALL, COUNT, GROUP BY (Doc ID 1317045.1)

Last updated on SEPTEMBER 22, 2016

Applies to:

Oracle TimesTen In-Memory Database - Version 11.2.1.0.0 to 11.2.1.8.0 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 02-Oct-2013***
***Checked for relevance on 05-Mar-2015***

Symptoms

On TimesTen version 11.2.1.0.0 - 11.2.1.8.1, a query that satisfies all of the following three conditions could return wrong results.

  1. There's SET OPERATOR or OUTER JOIN
    • UNION, UNION ALL, MINUS, INTERSECT, OUTER, OUTER JOIN, and (+)
  2. There's COUNT function
  3. There's GROUP BY clause

The following query is one example of the queries that satisfy above all three conditions and could return wrong results.

select * from
(select count(*) a from tab1 group by col1
union all
select count(*) from tab2 group by col1);



The following query is an counter-example that doesn't satisfy the condtion 3 because GROUP BY clause
is outside of a sub-query.

select * from
(select count(*) a from tab1
union all
select count(*) a from tab2) t1
group by t1.a;

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