sql query - pulling 2 rows -
possible duplicate:
sql - query between 2 rows
sorry, having hard time modifying previous question. , think might have formed question incorrectly...again new @ this. i'm doing select need grab 2 rows. have value of 13000.00000 (range). need grab both rows 2 , 3 since falls between 10000 (min range) , 15000 (min range)
this statement pulls in row 2.
select * table1 13000 ?? range; table1 row range return_value 1 0.00000 1.15 2 10000.00000 1.25 3 15000.00000 1.35 4 20000.00000 1.14
thanks!
it seems need both of following
- return row corresponds range greatest value less input range
return row corresponds range smallest value more input range.
select * table1 range = (select max(range) table1 subt1 subt1.range < 13000) or range = (select min(range) table1 subt1 subt1.range > 13000)
Comments
Post a Comment