Skip to Main Content

Feature Details

Buttons

Feature Details Container

DISTINCT Option for LISTAGG Aggregate

Application Development → SQL

The LISTAGG aggregate function now supports duplicate elimination by using the new DISTINCT keyword.

Business Benefit: The LISTAGG aggregate function orders the rows for each group in a query according to the ORDER BY expression and then concatenates the values into a single string. You can remove duplicate values from the specified expression before concatenation into a single string using the new DISTINCT keyword. This removes the need to create complex query processing to find the distinct values before using the aggregate LISTAGG function. Use the DISTINCT option to remove duplicate values within the LISTAGG function. The result is simpler faster more efficient SQL.

Release Availability
11.2
12.1
12.2
18c
19c
21c
23ai
Available On
All Offerings
Initial Release
19c