I'm trying to make this SQL work, any advice on how to do this? And the column id does exist!
My code:
SELECT Posts_Comments.postid FROM Posts_Comments LEFT JOIN (
SELECT
Replies.id
FROM Posts_Comments
WHERE Replies.id != 0
ORDER BY Replies.id
LIMIT 1
) AS Replies ON Posts_Comments.postid = Replies.postid AND Posts_Comments.blogid = Replies.blogid AND Posts_Comments.id = Replies.reply
This is my error:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Replies.id' in 'field list'