Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Copy row and alter a column
jeanch_at_my-deja.com schrieb in Nachricht <864mfu$8rn$1_at_nnrp1.deja.com>...
>INSERT INTO tab SELECT * FROM tab WHERE EID = 41
>
>"AND"
>UPDATE tab set state = 2 where eid = 41 and rownum = 1;
suppose tab is defined as (c1, c2, c3, state, c4, ... cn) - USE:
insert into tab (eid, c1, c2, c3, state, c4, ... cn)
select eid, c1, c2, c3, 2, c4, ... cn
from tab
where eid = 41
and .... (*)
MIND:
a) the primary key consists of eid + .... (*) ? ! - perhaps state ?
b) the additional primary key column condition goes into .... (*)
regards Received on Mon Jan 24 2000 - 22:31:48 CST