WITH ctePromo AS ( Select u.Id as UserId,p.Id as PostId,...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Spanish Language

Q&A for linguists, teachers, students and Spanish language enthusiasts in general wanting to discuss the finer points of the language

WITH
  ctePromo AS
  (
Select 

u.Id as UserId,p.Id as PostId,
DateDiff(day, u.CreationDate, getdate()) as DateDiff, 
ROW_NUMBER() OVER(PARTITION BY u.Id ORDER BY p.CreationDate ) as Promo_Level
from Posts p

LEFT JOIN Comments c
on p.Id=c.PostId
Left JOIN Users u
on c.UserId=u.Id
where DateDiff(day, u.CreationDate, getdate()) >(365*2)
)

select 
*
from ctePromo
where Promo_Level=10

Enter Parameters

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