Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql script help

Status
Not open for further replies.

mkey

Programmer
Oct 3, 2001
288
CA
HI all,

Logic of the script is listed below. Now I'm not sure if I could do this with a SQL or I have to write PL/SQL.
Anyway this is how the script looks like:

SELECT one_step_before_Last(STATION_POINT.MEASURE) AS LastOfMEASURE,
one_step_before_Last(COORDINATE.X_COORD) AS LastOfX_COORD,
one_step_before_Last(COORDINATE.Y_COORD) AS LastOfY_COORD,
one_step_before_Last(COORDINATE_SOURCE.ACCURACY) AS LastOfACCUR
FROM DEMO.STATION_POINT,DEMO.COORDINATE_SOURCE,
DEMO.COORDINATE
WHERE STATION_POINT.LOCATION_ID = COORDINATE.LOCATION_ID
AND COORDINATE.COORDINATE_SOURCE_ID = COORDINATE_SOURCE.COORDINATE_SOURCE_ID
AND (STATION_POINT.ROUTE_ID = -1999999999 And STATION_POINT.MEASURE < 24)

What I want is when ever the STATION_POINT.MEASURE < 24(now the 24 is dynamic, it can be any number)
I want to get the measure before 24. Similarly when the STATION_POINT.MEASURE > 24 I want to get the
next measure after 24.

Any thoughts on this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top