简体   繁体   中英

Comparing Two parts of two String in mysql

I have columns in my db called range which stores values like this "2500-3000", and i am receiving and input from the client in the same format. What i want to do is search through my db to find the range in which the clients input will fall. what i need is an sql query that could effectively compare those ranges.

Use BETWEEN operator

SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN 2500 AND 3000.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM