Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Select data between values.
01-23-2012, 12:48 AM #1
- Join Date
- Dec 2009
- Thanked 1 Time in 1 Post
Select data between values.
i wanna select data between 2 prices. What mysql syntax code i'd use?
01-23-2012, 03:01 AM #2Code:
SELECT * FROM table WHERE price BETWEEN 13 AND 27
CAUTION: BETWEEN is *inclusive*. So both 13 and 27 would be found with that code. If you wanted greater than 13 and less than 27 (e.g., 13.01 to 26.99) the best thing to do would be to use two separate comparisons:
SELECT * FROM table WHERE price > 13 AND price < 27An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.