Start of change

-20435 THE SELECT CLAUSE INCLUDES MULTIPLE INVOCATIONS OF THE ARRAY_AGG FUNCTION. ALL INVOCATIONS THAT EXPLICITLY SPECIFY AN ORDER BY CLAUSE MUST SPECIFY THE SAME ORDER.

Explanation

The SELECT clause includes multiple invocations of the ARRAY_AGG function. One of the following conditions is also true:

  • More than one invocation of the ARRAY_AGG function includes an ORDER BY clause. The sort keys in some of those ORDER BY clauses specify different sort orders. The sort orders in all ORDER BY clauses in the ARRAY_AGG function invocations must be the same.

System action

The statement cannot be processed.

Programmer response

Take one of the following actions:

  • Change the sort keys in the ORDER BY clauses of the ARRAY_AGG invocations in the SELECT list so that they are all identical.
  • Remove the ORDER BY clause from all except one ARRAY_AGG invocation in the SELECT list.

SQLSTATE

428GZ

End of change