Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles
DECLARE @MyPosts TABLE(Id INT PRIMARY KEY); INSERT @MyPosts VALUES (10259157), (7299871), (3644305), (10671558), (7490758), (6504173), (8015482), (7667073), (10588556), (10603095); SELECT q.Id, q.PostTypeId, q.CreationDate, q.OwnerUserId ,r.DisplayName, r.EmailHash ,a.Id, a.PostTypeId, a.CreationDate, a.OwnerUserId --,u.DisplayName, u.EmailHash, u.Age, u.CreationDate ,pf.* FROM Posts q INNER JOIN @MyPosts my ON q.Id = my.Id INNER JOIN Users r ON q.OwnerUserId = r.Id INNER JOIN Posts a ON a.ParentId = q.Id --INNER JOIN Users u ON a.OwnerUserId = u.Id LEFT JOIN PostFeedback pf ON q.Id = pf.PostId WHERE q.PostTypeId = 1 --1=Q, 2=A ORDER BY q.CreationDate ASC