Advertisement
knoteva

Untitled

Oct 13th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. CREATE FUNCTION udf_UserTotalCommits(@username VARCHAR(80))
  2. RETURNS INT
  3. AS
  4. BEGIN
  5. DECLARE @countUsers INT = (
  6. SELECT COUNT(c.Id)
  7. FROM Users AS u
  8. JOIN Commits AS c ON u.Id = c.ContributorId
  9. WHERE u.Username = @username
  10. )
  11. RETURN @countUsers
  12. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement