How to select user_ids by B meta_key and order by ratings meta_value?
user_id | meta_key | meta_value
-----------------------------------------------------
1 A 1
1 B 1
1 C 1
1 rating 9
8 A 1
8 C 1
8 rating 99999
7 A 1
7 B 1
7 C 1
7 rating 999
I need to get an IDs of users who have B meta_key and, then, to order IDs by user rating values.
Try this: