Following is the table and script of this table.
DECLARE @temp TABLE (PPId INT, SVPId INT, Minimum INT, Maximum INT)
INSERT INTO @temp VALUES(1,1,8,20)
INSERT INTO @temp VALUES(2,1,21,100)
Minimum & Maximum are passed in as parameter. I want to find all rows that fall in the given range.
E.g.;
- If @minimum = 9 and @maximum = 15 then it falls in the range of first row.
- If @minimum = 21 and @maximum = 22 then it falls in the range of 2nd row.
- If @minimum = 7 and @maximum = 25 then it falls in the range of both rows so both rows should be returned.
Thanks.