Mengurutkan elemen dalam list. Support ascending/descending dan kontrol posisi NULL.
LISTDiperbarui: 12 Jul 2026LIST_SORT(list) | LIST_SORT(list, 'ASC'|'DESC') | LIST_SORT(list, order, nulls_position)List yang akan diurutkan
'ASC' (default) atau 'DESC'
Default: ASC
'NULLS FIRST' atau 'NULLS LAST'
Default: NULLS LAST
1 SELECT LIST_SORT([3, 1, 4, 1, 5, 9, 2, 6]) AS sorted;
Mengurutkan angka ascending (default).
1 SELECT LIST_SORT([3, 1, 4, 1, 5], 'DESC') AS sorted;
Mengurutkan descending.
1 SELECT 2 LIST_SORT([3, NULL, 1, NULL, 2]) AS nulls_last, 3 LIST_SORT([3, NULL, 1, NULL, 2], 'ASC', 'NULLS FIRST') AS nulls_first;
Kontrol posisi NULL.
1 SELECT LIST_SORT(['banana', 'apple', 'cherry', 'date']) AS sorted;
Sort string secara alphabetical.
Sudah paham LIST_SORT? Latih langsung di browser
Latihan interaktif, langsung di browser.