MySQL选择“之间”和“AND”

我有一部分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
上一篇:2021牛客暑期多校训练营3A-Guess and lies【dp】


下一篇:MGI数据库挖掘 | MGI-Mouse Genome Informatics | InWeb database