Ratio of having a badge by logarithmic rep

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

SELECT
  FLOOR(1.0 * LOG(Users.Reputation) / Log(##Logbase:float?1.3##)) AS LogRep,
  100.0 * COUNT(Badges.UserId) / COUNT(*) AS PctMortarboard
FROM Users
LEFT JOIN Badges ON
  Badges.UserId = Users.Id
  AND
  Badges.Name = ##BadgeName:string?Mortarboard##
  AND
  Badges.TagBased = ##TagBased:int?0##
  AND
  Badges.Class = ##BadgeClass:int?3##
GROUP BY FLOOR(1.0 * LOG(Users.Reputation) / Log(##Logbase##))
ORDER BY LogRep

Enter Parameters

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