Re: Weird ORACLE update statement
Date: 8 Dec 92 17:35:06 GMT
Message-ID: <1992Dec8.173506.7648_at_pony.Ingres.COM>
In article <1992Dec8.153620.9115_at_infonode.ingr.com>, mcintyre_at_infonode.ingr.com (John Scott Mcintyre) writes...
> I am using ORACLE and want to be able to update rows in table1 using
> columns from table2 when the two tables can be joined.
>
> The SQL statement I would like to perform would look like this:
>
> update table1 set table1.manufacturer=table2.manufact,
> set table1.pur_cost=table2.sale_cost
> where table1.inv_number=table2.inv_number;
>
> The problem is UPDATE apparently cannot handle multiple tables.
>
Try using a correlated update ie UPDATE FROM...
Try...
UPDATE table 1
FROM table2
SET table1.manufacturer=table2.manufact,
table1.pur_cost=table2.sale_cost
WHERE table1.inv_number=table2.inv_number;
_____________________________________________________________________________
|Jon Machtynger | Ahhh Brisbane, center of the world. How I miss a Silvio's
|jonm_at_ingres.com | Pizza A Jug of Powers and a good spew in the Mall.
+----------------+
#include <StdDisclaimer.h>
On UserEvent 'YouAreBeingHeckled'=
{
While (Status != SS_UNDERSTOOD) Do Status = Object(CurFrame.TriggerField).KickInHead(). EndWhile
} Received on Tue Dec 08 1992 - 18:35:06 CET