I have site http://gamblejam.com/bookmakers.php (I didn't post for promoting) Presently they are sorted in default order but I'd like them to be show in such order that site with high rating in both bonus and site fields should be first and so on. bonusrating and siterating in db store values for them. Is it possible to take out average of bonus+siterating then sort them in DESC order? I have attached a screenshot of my DB for referrence. I'll appreciate any sort of help. Thanks
Of course it makes a difference. Put these in order: B, C, A Now tell me what's (B + C) / 2 Btw, I don't think you want to average those fields anyway. You said you want the site with high ratings in both. Averaging those won't get you that. What you need to do is figure out which field is more important and sort by that one first and the other second. Let's say siterating is more important. You'd do ORDER BY siterating DESC, bonus DESC So it would sort by siterating and for rows with equal siterating you'd sort those by bonus. If you really want to sort by which row has the highest combined siterating + bonus you'll either need to convert those fields to a numerical type or add a third column where you store the combined value.
Thank you very much, I got desired results. The problem was that I was trying it as "siterating,bonus DESC" while it should have been like what you mentioned. Thanks again