Forum Discussion
vishwajeet_hol
10 years agoExpert
Hi VarunGrazitti,
Used below code given by you :
SELECT * FROM messages WHERE category.id IN ('CATEGORY_ID') AND is_solution = true ORDER BY metrics.views DESC LIMIT 6It gives six solutions in that category ordered by no. of views.
Suppose, I want only one solution per topic.
That meance if a post has multiple solutions,I want only a single latest solution.
I think we have to use Distinct topic.id for this.
Any idea about how to implement it.
Thank you.
Regards,
Vishwajeet