My Oracle Support Banner

WRONG RESULTS FOR COLLECT FUNCTION USING DISTINCT AND ORDER BY (Doc ID 2925359.1)

Last updated on APRIL 17, 2023

Applies to:

Oracle Database - Enterprise Edition - Version 18.0.0.0 to 21.1 [Release 18 to 21.0]
Information in this document applies to any platform.

Symptoms

If the COLLECTION function includes an ORDER BY clause, it will negate the DISTINCT condition.

This should return a collection (1,2)
instead it returns (1,1,2,2)

This has been tested on 11.2.0.4, 12.1.0.2, 12.2.0.1, 18.3.0.0, and Oracle's own live SQL which, as of this submission, is running 19.2.0.0

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.