Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图简单地选择价格范围内的产品,在这种情况下在 160 美元到 200 美元之间。查询看起来很正常,但它也包括价格为 123 美元的产品。
SELECT * FROM product WHERE name LIKE '%test%' AND price >= '160' AND price <= '200' AND 1=1 LIMIT 50
有任何想法吗?
为什么不使用BETWEEN?
BETWEEN
SELECT * FROM product WHERE name LIKE '%test%' AND price BETWEEN 160 AND 200 LIMIT 50