realtordotcom
9 years agoContributor
Sorting based on replies count, giving wrong result.
Am trying to sort posts based on replies count, but we are getting wrong result from the query.
Please find below query which am using for sorting.
select * from messages where depth = 0 ORDER BY replies.count(*) DESC
Please suggest anything am doing wrong or wrong query am using.
Results returned from API
15 replies
14 replies
12 replies
10 replies
8 replies
9 replies
4 replies
There is a jumbled between 5th and 6th response as mentioned in above response.