Mysql小于或等于+不等于0

时间:2014-07-11 01:26:49

标签: php mysql

我有这个Mysql代码

SELECT * FROM `members` WHERE (bandwidth<='$calc_total_bandwidth' AND username!='$usern') ORDER BY RAND() LIMIT 1

带宽&lt; ='$ calc_total_bandwidth'=小于等于

但我仍然坚持我也能做到这一点所以它“不等于0”?

1 个答案:

答案 0 :(得分:0)

WHERE子句中只有AND一个!=0吗?

SELECT * FROM `members`
WHERE `bandwidth` != 0
AND `bandwidth` <= '$calc_total_bandwidth' 
AND `username` != '$usern'
ORDER BY RAND()
LIMIT 1