Team Metova

2

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

CREATE TABLE #MetovaUsers (Name nvarchar(100), StackOverflowUserId int)

INSERT INTO #MetovaUsers (Name, StackOverflowUserId)
SELECT 'Nick Griffith', 2792531
UNION SELECT 'Andrew Neal', 420015
UNION SELECT 'Jason Robinson', 291827
UNION SELECT 'Nick Sinas', 78550
UNION SELECT 'Logan Gauthier', 4431666
UNION SELECT 'Zachary Hensley', 3987923
UNION SELECT 'Ron Unger', 178758
UNION SELECT 'Levi Hobbs', 2539607
UNION SELECT 'Logan Serman', 29595
UNION SELECT 'Chris Johnson', 720083
UNION SELECT 'Not Dave Lane', 672380
UNION SELECT 'Riley Mills', 634997 

SELECT MU.Name, 

  /* STACK OVERFLOW */
  'http://stackoverflow.com/users/' + CAST(SOU.Id as nvarchar) + '|' + SOU.DisplayName AS SOUserName, 
  SOU.Reputation AS StackOverflowRep,
  SOU.CreationDate AS SOJoinDate,
  SOU.Reputation / DATEDIFF(WEEK,SOU.CreationDate,GETDATE()) AS [SO Rep/Week Average],
  
  /* CODE REVIEW */
  'http://codereview.stackexchange.com/users/' + CAST(CRU.Id as nvarchar) + '|' + CRU.DisplayName AS CRUserName, 
  CRU.Reputation AS CodeReviewRep,
  CRU.CreationDate AS CRJoinDate,
  CRU.Reputation / DATEDIFF(WEEK,CRU.CreationDate,GETDATE()) AS [CR Rep/Week Average],
  
  /* PROGRAMMERS */
  'http://programmers.stackexchange.com/users/' + CAST(PU.Id as nvarchar) + '|' + PU.DisplayName AS ProgrammersUserName,
  PU.Reputation AS ProgrammersRep,
  PU.CreationDate AS ProgrammersJoinDate,
  PU.Reputation / DATEDIFF(WEEK,PU.CreationDate,GETDATE()) AS [Programmers Rep/Week Average]
  
FROM #MetovaUsers MU
  INNER JOIN StackOverflow.dbo.Users SOU ON SOU.Id = MU.StackOverflowUserId
  LEFT OUTER JOIN [StackExchange.CodeReview].dbo.Users CRU ON CRU.AccountId = SOU.AccountId
  LEFT OUTER JOIN [StackExchange.Programmers].dbo.Users PU ON PU.AccountID = SOU.AccountId
ORDER BY ISNULL(SOU.Reputation,0)+ISNULL(CRU.Reputation,0)+ISNULL(PU.Reputation,0) DESC

Enter Parameters

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