我有一部分sql选择:
where `zipCode` between "40000" and "42000"
OR `zipCode` between "50000" and "51000"
OR `zipCode` between "53000" and "60000"
AND plan = "sell"
AND created_at > '2017-01-01'
AND clone_id is not null
我正在获得zipCode的正确范围.但是“计划”“ceated_at”和“clone_id”的条件不起作用.
解决方法:
Try below query :
where ( `zipCode` between "40000" and "42000" OR `zipCode` between "50000" and
"51000" OR `zipCode` between "53000" and "60000" )
AND plan = "sell" AND created_at > '2017-01-01' AND clone_id is not null