This one doesn't work either:

Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
General error;-5016 POS(27) Missing delimiter: =.
UPDATE USERDB.RMA R SET R.RMA_TOTAL = (SUM(R.ITEM_TOTAL) +
SUM(R.MISC_CHARGE) + SUM(R.FREIGHT_CHARGE)) WHERE R.RMA_ID = 2045001 AND
R.ACTIVE='Y';

-----Original Message-----
From: Kevin Wilson 
Sent: Wednesday, February 18, 2004 9:27 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Update from tables?


Well this isn't necessarily true because if it were then this statement
would work:

UPDATE USERDB.RMA A SET A.ITEM_TOTAL = (SELECT (SUM(B.WARRANTY_CHARGE) +
SUM(B.LABOR_CHARGE) + SUM(B.PARTS_CHARGE)) FROM USERDB.RMA_ITEM B WHERE
B.RMA_ID = 2045001 AND B.ACTIVE='Y') WHERE A.RMA_ID = 2045001;

error = General error;-5016 POS(27) Missing delimiter: =.

running sapdb v7.4.0.46 on SuSE Linux

-----Original Message-----
From: Zabach, Elke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 12:19 AM
To: 'Jos� R�mulo El�as Contreras'; [EMAIL PROTECTED]
Subject: RE: Update from tables?


 Jos� R�mulo El�as Contreras wrote:

> 
> How can I do an update of a table usign values from different 
> tables to 
> set it?
> 
Use subqueries like this:
UPDATE t SET a = (SELECT col FROM base)

Elke
SAP Labs Berlin

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to