Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to get consecutive pairs from a table in SQL?

How to get consecutive pairs from a table in SQL?

From: dean <deanbrown3d_at_yahoo.com>
Date: 16 Nov 2005 13:00:15 -0800
Message-ID: <1132174815.519465.282530@o13g2000cwo.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US