sql select question
- From: hilz <now@xxxxx>
- Date: Tue, 25 Apr 2006 13:11:34 -0400
Hi all
this is more of an SQL question than a Java question.
I have a table with a SPEED column and some other columns like this:
SPEED SOME_OTHER_COLUMNS....
----- ------------------
100 some values here...
34
97
68
13
27
44
now I want to select the two rows that surround a value I am interested in. For example, if I am interested in a value of 55, I want to select the two rows that have a speed of 44 and 68.
Is there a way of doing that in SQL ?
i can handle the case where i get an exact match separately.
I just need to know how to select exactly two rows (the one above the given value and the one below it).
Thanks for any help.
.
- Follow-Ups:
- Re: sql select question
- From: ChrisH
- Re: sql select question
- Prev by Date: Re: java.sql.SQLException:ORA-00904
- Next by Date: Re: sql select question
- Previous by thread: java.sql.SQLException:ORA-00904
- Next by thread: Re: sql select question
- Index(es):
Relevant Pages
|
|