Close but no cigar. :)
SELECT * FROM table WHERE (x BETWEEN 20 AND 80) AND (y BETWEEN 20 AND 120) AND (z BETWEEN 10 AND 40) LIMIT 0 , 30
To explain, SQL servers usually evaluate x BETWEEN val1 AND val2 in the same way as x >= val1 AND x <= val2 . The way your initial request was written, the first condition would be x >= 120 AND x <= 20) , which was clearly not what you planned.
The parentheses around the various conditions make sure that each of them is fully evaluated before considering I. This plays most of the time in SQL, and even when it is not recommended to use them, so that your intentions are clear after 6 months, when you (or anyone else) will have to search again for the request.
source share