sql - How to search between columns in mysql -


i have 2 columns store values(numbers), how select given number between values in 2 columns?

example

   `id | col1 | col2`       `1 | 20  | 50`       `2 | 200 | 400`       `3 | 500 | 650` 

if have value of 25, how can select records value of 25 between them in case row 1

select * mytable 25 between col1 , col2; 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -