Q&A about the site for administrators, end users, developers and designers for Craft CMS
SELECT Users.Id, Users.Location, Badges.Name, Posts.Id, MAX(Posts.CreationDate) FROM Badges, Users, Posts, PostTypes Where Users.Id = Badges.UserId and Users.Id = OwnerUserId and Posts.PostTypeId = PostTypes.Id and Users.Location like '%Latvia%' and Badges.Name = 'Editor' and PostTypes.Name = 'Question' GROUP BY Users.Id, Users.Location, Badges.Name, Posts.Id Order BY Users.Id ASC