Open this example in the interactive library
Source code
SELECT json_group_array(value ORDER BY key DESC) AS reversed FROM json_each('["one","two","three"]');
Sample output
[
{
"reversed": "[\"three\",\"two\",\"one\"]"
}
]
Reverse a JSON array in index order using SQLite JSON functions.
Open this example in the interactive library
SELECT json_group_array(value ORDER BY key DESC) AS reversed FROM json_each('["one","two","three"]');
[
{
"reversed": "[\"three\",\"two\",\"one\"]"
}
]