我有这个Mysql代码
SELECT * FROM `members` WHERE (bandwidth<='$calc_total_bandwidth' AND username!='$usern') ORDER BY RAND() LIMIT 1
带宽&lt; ='$ calc_total_bandwidth'=小于等于
但我仍然坚持我也能做到这一点所以它“不等于0”?
答案 0 :(得分:0)
WHERE子句中只有AND
一个!=0
吗?
SELECT * FROM `members`
WHERE `bandwidth` != 0
AND `bandwidth` <= '$calc_total_bandwidth'
AND `username` != '$usern'
ORDER BY RAND()
LIMIT 1