H
hilz
Hi all..
I have this situation where i am unable to write the select statement
that will do what i want.
i have a table ATABLE with a number of columns, two of which are SPEED
and DISTANCE.
as follows:
SPEED DISTANCE
----- --------
10 74
10 64
10 63
20 57
20 64
20 53
20 97
30 <= 43
30 <= 45 <=
30 <= 65 <=
30 <= 87
40 <= 23
40 <= 46 <=
40 <= 86 <=
40 <= 94
50 35
50 46
50 76
50 97
....
I have two numbers that i want to work with. let's say i have :
SPEED = 35
DISTANCE = 50
Now what I want to do is that I want to select the rows where the SPEED
equals the first value greater and smaller than 35,(i.e. 20 and 40), and
at the same time, the distance is the first value greater and lower than
50
in other words, the select statement needs to return to me the following
rows:
30 <= 45 <=
30 <= 65 <=
40 <= 46 <=
40 <= 86 <=
any help is greatly appreciated.
I have this situation where i am unable to write the select statement
that will do what i want.
i have a table ATABLE with a number of columns, two of which are SPEED
and DISTANCE.
as follows:
SPEED DISTANCE
----- --------
10 74
10 64
10 63
20 57
20 64
20 53
20 97
30 <= 43
30 <= 45 <=
30 <= 65 <=
30 <= 87
40 <= 23
40 <= 46 <=
40 <= 86 <=
40 <= 94
50 35
50 46
50 76
50 97
....
I have two numbers that i want to work with. let's say i have :
SPEED = 35
DISTANCE = 50
Now what I want to do is that I want to select the rows where the SPEED
equals the first value greater and smaller than 35,(i.e. 20 and 40), and
at the same time, the distance is the first value greater and lower than
50
in other words, the select statement needs to return to me the following
rows:
30 <= 45 <=
30 <= 65 <=
40 <= 46 <=
40 <= 86 <=
any help is greatly appreciated.