Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想按评级订购一系列商品。有 2 个字段:rateup 和 ratedown。我使用这些字段来计算一个数字并对该数字进行排序。可以在mysql中完成吗?我有一个这样的查询,但这不起作用:
SELECT * FROM table ORDER BY (((9/rateup+ratedown)*rateup)+1) DESC
我怎样才能使这项工作或这是不可能的?
Select *, (((9/rateup+ratedown)*rateup)+1) As Ord from Table WHERE published = 1 Order By Ord Desc
根据要求添加了 Where 子句。