Joining WordPress Comments with Post Titles from MySQL DB
SELECT * FROM wp_posts WHERE id IN (SELECT comment_post_id FROM wp_comments);


or

SELECT A.* FROM wp_posts A INNER JOIN
(SELECT comment_post_id FROM wp_comments) B
ON A.id = B.comment_post_id;