Используя lists:keysort/2
, например:
1> Result = [{users, jim, 9},
{users, ham, 3},
{users, why, 2},
{users, dhh, 3},
{users,zend, 4}].
[{users,jim,9},
{users,ham,3},
{users,why,2},
{users,dhh,3},
{users,zend,4}]
2> lists:keysort(3, Result).
[{users,why,2},
{users,ham,3},
{users,dhh,3},
{users,zend,4},
{users,jim,9}]