ulivegenov

/* 09. Most Contributed Repositories */

Oct 13th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. SELECT TOP(5)
  2. r.Id,
  3. r.[Name],
  4. COUNT(rp.ContributorId) AS Comits
  5. FROM Repositories AS r
  6. JOIN Commits AS c ON c.RepositoryId = r.Id
  7. JOIN RepositoriesContributors AS rp ON rp.RepositoryId = r.Id
  8. GROUP BY r.Id, r.[Name]
  9. ORDER BY COUNT(rp.ContributorId) DESC, r.Id, R.[Name]
Advertisement
Add Comment
Please, Sign In to add comment