如何使用订购方式获得折扣价


How to use order by for discounted prices

我的数据库表产品中有两列。

price   discountpercent    
100     10    
200     70

我的查询

 SELECT * FROM products order by ?

如何以折扣价订购?

使用:

ORDER BY price * (100 - discountpercent) / 100

在这里演示