ARRAY_SORT_REVERSE
Description
The ARRAY_SORT_REVERSE
function is used to sort the input array in descending order. This function accepts an array as a parameter and returns a new array with elements sorted from largest to smallest.
Parameter Description
array
: Input parameter, typearray<T>
, representing the array to be sorted.
Return Result
Returns a new array of type array<T>
, with elements sorted in descending order.
Usage Example
- Sort an integer array in descending order:
- Sort the floating-point number array in descending order:
- Sort the array of strings in descending order according to the dictionary order of the strings:
Precautions
- The element types in the input array must be consistent.
- This function is sensitive to
NULL
values in the array, andNULL
values will be placed at the end of the returned array.