Q&A for users, experts, and developers of the Tezos blockchain project
---by changing mult you decide how the users are divided into groups ---for example, if mult=10, we're looking at users with 0 to 9 posts, users with 10 to 19 posts, etc. ;with postgroups_cte AS ( SELECT u.Id AS uid, u.Reputation AS rep, CAST(COUNT(p.Id)/##mult?100## AS int) AS pgroup FROM Users u INNER JOIN Posts p ON p.OwnerUserId=u.Id GROUP BY u.Id, u.Reputation ) SELECT pgroup, AVG(CAST(rep AS decimal)) AS Average FROM postgroups_cte GROUP BY pgroup ORDER BY pgroup DESC