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 -> Create new table from old table with .....

Create new table from old table with .....

From: Stefan den Engelsman <Stefan.denEngelsman_at_nl.origin-it.com>
Date: Sun, 20 Jun 1999 18:06:05 +0200
Message-ID: <0E16861EE7BCD111BE9400805FE6841F09DC7BE3@c1s5x001.cor.srvfarm.origin-it.com>


All,

Can anybody help me finding a SQL or PL/SQL to solve the following problem.

I have a table which contains priority changes and timestamp of this priority changes for a specific req_id :

Description

unix_timestamp      req_id

------------------------------------------------------- -
--------------------- ------------------- FIELD='priority' OLD='2' NEW='1' 924248880 557544 FIELD='priority' OLD='1' NEW='2' 924769137 557544 FIELD='priority' OLD='2' NEW='1' 924777987
557544
FIELD='priority' OLD='1' NEW='2'                              925822510
661106
FIELD='priority' OLD='2' NEW='3'                              925824067
661106

From this table I like to create the following table in which a new column next_timestamp is added. This column should contain the value of the next unix_timestamp for a specific req_id.

Description

unix_timestamp      next_timestamp    req_id

------------------------------------------------------- -
--------------------- ---------------------- ------------------- FIELD='priority' OLD='2' NEW='1' 924248880 924769137 557544 FIELD='priority' OLD='1' NEW='2' 924769137 924777987 557544 FIELD='priority' OLD='2' NEW='1' 924777987 - 557544 Description unix_timestamp next_timestamp req_id
------------------------------------------------------- -
--------------------- ---------------------- ------------------- FIELD='priority' OLD='1' NEW='2' 925822510 925824067 661106 FIELD='priority' OLD='2' NEW='3' 925824067 - 661106

Any suggestions

Thanks

Stefan Received on Sun Jun 20 1999 - 11:06:05 CDT

Original text of this message

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