gpt4 book ai didi

php - 如何使用 order by 获得折扣价

转载 作者:行者123 更新时间:2023-11-29 11:40:19 27 4
gpt4 key购买 nike

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

price   discountpercent    
100 10
200 70

我的查询

 SELECT * FROM products order by ?

如何以折扣价订购?

最佳答案

用途:

ORDER BY price * (100 - discountpercent) / 100

Demo here

关于php - 如何使用 order by 获得折扣价,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35897809/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com