Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to get consecutive pairs from a table in SQL?
I have a train's route table as follows (for one train):
LOCATION_I varchar2(6) not null
ORDERnumber not null
The table lists all the stations that the train goes through.
Is there a simple way to get consecutive pairs of these locations, if they are ordered by ROUTE_ORDER_I? I've done some SUM OVER queries, so was wondering if there was anything similar.
Thanks,
Dean Received on Wed Nov 16 2005 - 15:00:15 CST