A forum has topics and in this topics are the posts. The sort order is from old to new. It is possible to rate each post with "helpful".
A default SQL selection looks like this:
SELECT * FROM `posts` WHERE `topic_id` = 5033 ORDER BY `post_id` ASC
The "helpful" field in the posts table has the name "post_helpful".
Is it possible to order the posts in this way:
- First post - Contains the question
- If a post with more then 3 "post_helpful" exists, display this post as the second post. But only the post with the highest score.
- Normal post row without the second post id
I only want the post with the highest score on the second post position. But only if the post has more than 3 rates. If there is no post with more than 3 rates, keep the default order
Thank you