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: Update SQL Problem

Re: Update SQL Problem

From: Ismo Tuononen <ismo_at_sasu1.carelian.fi>
Date: 1998/02/13
Message-ID: <6c177s$jna$1@hiisi.inet.fi>#1/1

"Mark Buffington" <mbuffington_at_Excel.Net> writes:

>I have problem where I want to update the contents of one field with the
>contents of another field in another table.
 

>Table A has part and description.
>Table B has part and description plus many other fields.
 

>I want to update B's description with the description from A where all the
>parts are equal.
 

>Can this be done using straight SQL?

if part is unique in a:

update b tb set description=(select ta.description from a ta where

                             ta.part=tb.part)
where tb.part in (select part from a);

if part is not unique in a, then above don't work.

>Thanks,
>Mark
  Received on Fri Feb 13 1998 - 00:00:00 CST

Original text of this message

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