Q&A for users and developers of the Cardano cryptocurrency ecosystem
SELECT TOP 1000 u.Reputation, u.CreationDate, u.DisplayName, u.LastAccessDate, u.WebsiteUrl, u.Location, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, COUNT(p.Id) AS TotalPosts, AVG(p.Score) AS AveragePostScore, SUM(p.Score) AS TotalVotes, DATEDIFF(DAY, u.CreationDate, GETDATE()) AS AccountAge FROM users u LEFT JOIN posts p ON u.id = p.OwnerUserId GROUP BY u.Reputation, u.CreationDate, u.DisplayName, u.LastAccessDate, u.WebsiteUrl, u.Location, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.id ORDER BY NEWID(); -- Randomly orders the rows