Test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Islam Meta

Q&A about the site for Muslims, experts in Islam, and those interested in learning more about Islam

-- 8.Using a SQL join, add a column to display the number of unique Badges
-- earned by the users identified in question 3.

SELECT  DisplayName,
Users.Id,
Location,
Reputation,
sum(distinct(cast(Badges.Id as bigint))) as BadgeCount
FROM Users left join Badges
on Users.Id = Badges.UserId
Where Reputation >= 550000
group by DisplayName,
Users.Id,
Location,
Reputation
order by BadgeCount desc

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results