Q&A about the site for enthusiasts and scholars of mythology and folklore
-- 4. Find all users from Latvia who have Editor badge. -- In the second column, please, add the -- last question post created by that user. SELECT TOP 10 Users.Id, Users.DisplayName, LastQuestionPost.* FROM Users INNER JOIN Badges ON Badges.UserId = Users.Id AND Badges.Name = 'Editor' CROSS APPLY ( SELECT TOP 1 * FROM Posts WHERE Posts.OwnerUserId = Users.Id ORDER BY Posts.CreationDate DESC ) LastQuestionPost;