0

I have a table with 3 columns as follows:

lower upper id
12 20 100
100 150 200


I want to select range of numbers based on lower and upper column.
For example I want to display numbers between 12 to 20 or from 100 to 150.
How to do it. thanks in advance.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by ansari.wajid
0

Hi, you can use math comparison operators to select from a range of values, you can add an OR to the statement below to select from an additional range.

SELECT
*
FROM
TableName
WHERE 
([lower] >= 12
 AND 
[upper] <= 20)
OR
([lower] >= 100
 AND 
[upper] <= 150)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.