I have a table with 2 columns a and b. I want to write a query to search a number is available in the column or the number falls between those 2 columns. I tried using >=,<= also with between but it is not returning any result.
Could someone help me with the query?
- If the input parameter is 1, it should return true.
- If the input parameter is 3, it should return true.
- If the input parameter is 7, it should return true.
- If the input parameter is 15, it should return false.
Thanks
Table with values and expected output:

Say you have a couple of tables like the following:
You can use
BETWEEN,CASE, andEXISTSto achieve your desired output:Output: