Reputation: 43
select c.*
from costs c
where 32 between c.x and c.x + c.deltax and 34 between c.y + c.deltay
order by priority desc
limit 1
Keeps saying #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by priority desc limit 1' at line 4
. What am I missing?
Upvotes: 0
Views: 183
Reputation: 247680
Your second between
only has one condition to check, it is missing the and
:
34 between c.y + c.deltay
Do you want to use?
34 between c.y and c.y + c.deltay
Upvotes: 2