Wordpress $ wpdb-> usermeta sort by meta_value
I am trying to display all meta_key based users called "dots" like this:
$wpdb->get_col($wpdb->prepare("
SELECT user_id, meta_key = 'points', meta_value
FROM $wpdb->usermeta
ORDER BY meta_value DESC
LIMIT $limit OFFSET {$paginate->offset()}"));
Users are displayed correctly, but the order does not work, meta_value is equal to a number from 1 to ∞. So how do I get it to work? Thank.
PS: This is the conclusion:
Array ( [0] => 1 [1] => 2 [2] => 4 )
So, I believe, sorted by ID.
+3