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?
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?