The following query displays select fields from the Users table. Modify the query to display the users ordered by decreasing reputation.
Q&A for Joomla! administrators, users, developers and designers
SELECT u.DisplayName, u.Id, u.Location, u.Reputation , b.BadgeCount FROM Users u left join (SELECT userid, count(distinct id) as BadgeCount FROM badges where year(date) = 2016 and month(date) = 1 group by userid) b on u.id = b.userid order by b.BadgeCount desc ;