Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
-- Assuming we have the OwnerUserId, let's call it @OwnerUserId -- Query to find the badges of the user who owns the most viewed post SELECT Name FROM Badges WHERE UserId = 1203366;