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 -> Re: Update table.

Re: Update table.

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 18 Sep 2002 15:23:31 +0200
Message-ID: <am9upu$j80$1@ctb-nnrp2.saix.net>


Kenneth Osenbroch wrote:

> Table A : Column A | Column B
> . | .
> Value 4 | Value 5
> Value 6 | Value 7
> Value 8 | Value 9
> . | .
>
> I need to uptdate Table A to become:
>
> Table A : Column A | Column B
> . | Value 4
> Value 4 | Value 6
> Value 6 | Value 8
> Value 8 | .

Only possible I think if you have some unique and sequential row identifier. Let's pretend that COLUMN C is a sequence number that numbers the rows in the correct sequence, with an increment of one, e.g.

Table A : Column A | Column B | Column C
          .        | .        |   1
          Value 4  | Value 5  |   2
          Value 6  | Value 7  |   3
          Value 8  | Value 9  |   4
          .        | .        |   5


You are now able to join row 2 with 1, 3 with 2, and so on, e.g. SELECT
  *
FROM table t1,

     table t2
WHERE t1.column_c = (t2.column_c+1)

However, without a column like C, you are not able to relate the a row to its successor or predecessor.

Is there a way that you can add a column C to the table?

--
Billy
Received on Wed Sep 18 2002 - 08:23:31 CDT

Original text of this message

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