Number of active users with >= 1 post in last 30 days

0

Please login or register to vote for this query.

(click on this box to dismiss)

Enter Query Description

Stack Overflow

Q&A for programmers

-- Enter Query Title
-- Enter Query Description

-- Enter Query Title
-- Enter Query Description

SELECT 
  Count(*)
  FROM Users
  WHERE 
    DATEDIFF(day,CreationDate, GETDATE()) > 30 AND
    DATEDIFF(day,LastAccessDate, GETDATE()) < 30 AND
    (SELECT
    Count(*) FROM Posts
      WHERE 
        (Posts.OwnerUserId = Users.Id) AND
        (DATEDIFF(day, CreationDate, GETDATE()) < 30)
    ) > 1

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached