WITH first_posts AS ( SELECT *, MIN(creationdate) OVER (P...

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Great Outdoors

Q&A for people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment

WITH first_posts AS (
  SELECT *,
         MIN(creationdate) OVER (PARTITION BY owneruserid, posttypeid) AS first_date
  FROM posts
  WHERE posttypeid = 1
)
SELECT COUNT(DISTINCT u.id)
FROM users AS u
JOIN first_posts AS p 
ON u.id = p.owneruserid
WHERE p.creationdate = p.first_date
AND u.location LIKE '%Russia%'
AND p.tags LIKE '%sql%'
AND YEAR(p.creationdate) = 2016

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results