0

我想按评级订购一系列商品。有 2 个字段:rateup 和 ratedown。我使用这些字段来计算一个数字并对该数字进行排序。可以在mysql中完成吗?我有一个这样的查询,但这不起作用:

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

我怎样才能使这项工作或这是不可能的?

4

1 回答 1

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

根据要求添加了 Where 子句。

于 2010-08-06T17:48:22.027 回答