I wanted to retrieve rows from the mysql database and order them by votes:
votes_up + votes_down = votes
table:
posts{id, post_text, votes_up, votes_down, date}
ORDER BY votes
SELECT id, post_text, votes_up, votes_down, date, sum(votes_up + votes_down) as 'Votes'
FROM posts
ORDER BY sum(votes_up + votes_down)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With