Using ORDER BY clause inside GROUP_CONCAT function in SQLite
SQLite doesn't support ORDER BY
inside a GROUP_CONCAT
, but you can actually fake it:
GROUP_CONCAT(list_order || ':' || value)
Then you need to split the result in code in order to get back your sort and value.