SELECT p.id ,c.text FROM posts p LEFT JOIN( SELECT c.postid

0

Please login or register to vote for this query.

(click on this box to dismiss)

Artificial Intelligence Meta

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

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results