Skip to content
Advertisement

MySQL Query join last comment to topic

I have a topic and topic_comments table. I want to join them both.

The join is on topic.id = topic_comments.parent_id. I want to show the topic with latest comment and order by latest comment createdate. And not show duplicate topics. Can anyone help me?

So far I have this:

This however doesn ‘t show topics without comments. It only returns topics with reactions.

Advertisement

Answer

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement