How to write this meaning in a MySQL query?
where ((location/'$location'<2) and (location/'$location'>=1))
How to write this meaning in a MySQL query?
where ((location/'$location'<2) and (location/'$location'>=1))
where location/'$location' between 1 and 2
Edit: Since it should only match those that are precisely 2, then this should work:
where location div '$location' = 2
If you want floating-point division, that should be fine, but if you want integer division:
WHERE location DIV '$location' IN (1, 2)
I would have to know a bit more about your database but are you trying to select something such as:
select location from -- some table
where ((location/'$location'<2) and (location/'$location'>=0))