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