id price tax item discount
1 500 15 100 0
2 0 15 200 1
3 100 15 500 0
4 0 15 300 0
5 1000 15 88 0
6 0 15 190 1
7 0 15 120 0
如果 price 和 discount 都不为零,则选择全部。
I don't want to select if the value of price and discount both are zero in mysql
只有当price和isDiscount都为0时才不选择...(只有一种情况)
Price IsDiscount Select
1 1 Yes
!0 0 yes
0 1 Yes
0 0 no
最佳答案
我可能在这里遗漏了一些东西,......但这不是那么简单吗
SELECT
id,tax,...
FROM
tablename
WHERE
price!=0
OR discount!=0
?
关于php - Mysql根据某种条件选择某个字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34761176/