Wrong Result when Fix for Bug 21099502 is Present on a Query which Uses UNION View and GROUP BY Clause
(Doc ID 2536136.1)
Last updated on APRIL 17, 2023
Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.4 and laterOracle Database - Standard Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.
Symptoms
NOTE: In the images and/or the document content below, the user information and data used represents fictitious data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product. Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.
Wrong result may be seen when the fix to bug 21099502 is present on a query which uses UNION view whose branches have GROUP BY clause, and there is a predicate in the outer query block.
Example:
SELECT
T1.COL1
FROM
T1,
( SELECT COL1,
COL2
FROM T1
WHERE COL3 = 1
UNION
SELECT COL1,
MAX(COL2)
FROM T1
WHERE COL3 = 2
GROUP BY COL1 ) SUB
WHERE
T1.COL1 = SUB.COL1 AND
T1.COL2 = SUB.COL2 AND
T1.COL1 in ('1','2','3','4');
SELECT
T1.COL1
FROM
T1,
( SELECT COL1,
COL2
FROM T1
WHERE COL3 = 1
UNION
SELECT COL1,
MAX(COL2)
FROM T1
WHERE COL3 = 2
GROUP BY COL1 ) SUB
WHERE
T1.COL1 = SUB.COL1 AND
T1.COL2 = SUB.COL2 AND
T1.COL1 in ('1','2','3','4');
Changes
None
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 |