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

Home -> Community -> Usenet -> c.d.o.server -> Re: Bad Field Update

Re: Bad Field Update

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Sun, 10 Aug 2003 16:59:22 +0200
Message-ID: <nbncjvob74ds4aunp9n2ldmama1fv0hmgn@4ax.com>


On 10 Aug 2003 07:30:03 -0700, nhojnacki_at_cox.net (MikeP) wrote:

>I intended to update certain rows in one table, instead I updated them
>all. What is the best way to recover the previous data in this one
>field, Or do I need to run a script that populates the field from
>another table. There is a table that does contain the correct data,
>but it is a one to many relationship ( the bad data has one value but
>the other has mulitple values for the same record ) and I'm not sure
>how this can be handled.
>
>regards
>
>-Mike

You could retrieve the correct data using distinct

update bla
set field = (select distinct other_field from other bla where <foreign key column in otherbla> = <primary key column in bla)

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Sun Aug 10 2003 - 09:59:22 CDT

Original text of this message

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