Question 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

The following query displays select fields from the Users table. Modify the query to display the users ordered by decreasing reputation.

Joomla

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
;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results