Reputation: 23
I'm a complete novice but I really need to get this done as soon as possible so any help would be greatly appreciated.
I have a table with the following fields: userid, upvoteds , downvoteds, aposts and aselecteds
Basically I need to run this formula for every row:
(upvoteds - downvoteds) / (aposts - aselecteds) Apologies if that formula isn't structured properly.
I need the results presented in desc order along with userid so I know who it belongs to.
Thanks in advance!
Upvotes: 1
Views: 665
Reputation: 56397
select userid,
(upvoteds - downvoteds) / (aposts - aselecteds) as result
from table
order by result desc
Upvotes: 8