Find all posts with tags which have both “html” and “css”

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

-- 3. Enhance the query created in point 2
-- in a way that the list of top users contains
-- only those users who have at least one post in 2021. 

SELECT Users.Id, Users.DisplayName, COUNT(Badges.Id) AS NumberOfBadges
FROM Users
INNER JOIN Badges ON Badges.UserId = Users.Id
WHERE Users.Location LIKE '%Latvia%'
  AND EXISTS (
      SELECT 1
      FROM Posts
      WHERE Posts.OwnerUserId = Users.Id
        AND Posts.CreationDate >= '2021-01-01'
        AND Posts.CreationDate < '2022-01-01'
  )
GROUP BY Users.Id, Users.DisplayName
HAVING COUNT(Badges.Id) > 100
ORDER BY NumberOfBadges DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results