My Oracle Support Banner

TimesTen SQL Using ORDER BY On A UNION ALL Does Not Return Correct Results - Bug 18317038 (Doc ID 1638623.1)

Last updated on JUNE 05, 2019

Applies to:

Oracle TimesTen In-Memory Database - Version 11.2.2.6.2 and later
Information in this document applies to any platform.

Symptoms

An SQL statement that has an order by on a union all result did not return the correct results.

Example without order by returns 12 rows:

select * from (select distinct a from x union all select distinct b from x );
< 0 >
< 1 >
< 2 >
< 3 >
< 4 >
< 5 >
< 5 >
< 4 >
< 0 >
< 1 >
< 3 >
< 2 >
12 rows found.

Example with 'order by' incorrectly returns 7 rows:

select * from (select distinct a from x union all select distinct b from x )
order by 1;
< 0 >
< 1 >
< 2 >
< 3 >
< 4 >
< 5 >
< 5 >
7 rows found.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.