View Full Version : Select data between values.
01-23-2012, 01:48 AM
i wanna select data between 2 prices. What mysql syntax code i'd use?
01-23-2012, 04:01 AM
SELECT * FROM table WHERE price BETWEEN 13 AND 27
??? is that what you mean?
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 < 27
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.