-20551 CONSTRUCTING AN ASSOCIATIVE ARRAY FAILED BECAUSE THE INPUT DATA INCLUDES AT LEAST ONE DUPLICATE ARRAY INDEX VALUE. DUPLICATED INDEX VALUE: value.
Explanation
In an associative array, each element is associated with a unique index value. When the ARRAY_AGG aggregate function is used to construct an array, if more than one element is associated with the same array index value, only one of the element values can be included in the array. This potential loss of element data is the reason that index values must be unique within the input data that is used to construct an associative array.
- value
- The duplicate array index value.
System action
The statement cannot be processed.
User response
Change the input data so that there are no duplicate array index values. When you use the ARRAY_AGG aggregate function, you might need to add predicates to the query that produces the aggregation grouping sets to ensure that none of the rows include duplicate values for the index-expression argument of the ARRAY_AGG function.
SQLSTATE
22545
