Jirinex Posted January 16, 2018 Share Posted January 16, 2018 Hello, I assume sorting a database posts by the amount of "likes" is not possible, so could anyone maybe point me to an sql query I could use to get this info? I have in one post about 300 or so post and I need them sorted by their likes. Thanks. Link to comment Share on other sites More sharing options...
Numbered Posted January 16, 2018 Share Posted January 16, 2018 Something like that? select type_id as post_id, count(id) as likes from core_reputation_index where type = 'pid' group by type_id order by likes desc limit 5; Link to comment Share on other sites More sharing options...
Jirinex Posted January 16, 2018 Author Share Posted January 16, 2018 Thanks a lot, that looks close to what I need, but can I also match the post id to the user who made the reply? Edit: I need this list for a specific article, not for all posts in the articles database. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.