Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
SELECT TOP(##num?100##) coalesce(p.ParentId, p.Id) AS [Post Link], ---returns the id of the question ---For questions p.ParentId is NULL, so this returns p.Id MAX(p.LastActivityDate) FROM Posts p WHERE coalesce(p.ParentId, p.Id) in (##list?3349,3910,4543,2657,3311,3271,4426,3178,599,1241,2798,1297,121,828,402,1338,1911,1852,4376,1253,730,3030,275,439,3065,2409,3014,808,1604,655,3317,3142,1113##) GROUP BY coalesce(p.ParentId, p.Id) ORDER BY MAX(p.LastActivityDate) DESC