Q&A about the site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment
SELECT p.id ,c.text FROM posts p LEFT JOIN( SELECT c.postid ,MAX(c.creationdate) as latest_comment FROM comments c GROUP BY c.postid) s ON s.postid = p.id JOIN comments c ON p.id = c.postid where s.latest_comment = c.creationdate