Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE FUNCTION udf_UserTotalCommits(@username VARCHAR(80))
- RETURNS INT
- AS
- BEGIN
- DECLARE @countUsers INT = (
- SELECT COUNT(c.Id)
- FROM Users AS u
- JOIN Commits AS c ON u.Id = c.ContributorId
- WHERE u.Username = @username
- )
- RETURN @countUsers
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement