开发者

Calculations in mysql statement for rating

I want开发者_StackOverflow社区 order a selection of items by the rating. There are 2 fields: rateup and ratedown. I use these fields to calculate a number and order the selection on that number. Can that be done in mysql? I have a querylike this, but this doesn't work:

SELECT * FROM table ORDER BY (((9/rateup+ratedown)*rateup)+1) DESC

How can I make this work or is this impossible?


Select *, (((9/rateup+ratedown)*rateup)+1) As Ord from Table WHERE published = 1 Order By Ord Desc

added Where Clause as requested.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜