Q&A for students, researchers and practitioners of computer science
SELECT PostId, Comment FROM (SELECT PostId, Comment, ROW_NUMBER() OVER (PARTITION BY PostId ORDER BY CreationDate DESC) AS rownum FROM PostHistory) ph WHERE rownum = 1;