Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language
SELECT usr.DisplayName ,pst.Id ,pst.CreationDate ,ROW_NUMBER() OVER (PARTITION BY pst.OwnerUserID ORDER BY pst.CreationDate) as 'Sequence' ,LAG(pst.CreationDate) OVER (PARTITION BY pst.OwnerUserID ORDER BY pst.Id) as PrevCreationDate ,LEAD(pst.CreationDate) OVER (PARTITION BY pst.OwnerUserID ORDER BY pst.Id) as NextCreationDate ,COUNT(pst.Id) OVER (PARTITION BY pst.OwnerUserID) as NumberOfPosts FROM Posts pst Inner Join Users usr ON usr.Id = pst.OwnerUserId WHERE OwnerUserID in (9625673, 7364570) --GROUP BY usr.DisplayName ORDER BY pst.CreationDate ;