What I'm trying to do here is clear though my syntax is wrong.
What's correct for the UPDATE statement?
create table table1( A int, B int, C int);
create table table2( A int, B int, C int, D int);
insert into table1 (A,B,C) values(1,1,99);
insert into table2 (A,B,C,D) values(1,1,15,27),(1,1,3,13);
SET table2.C = table1.C
WHERE table2.A = table1.A
AND table2.B = table1.B
AND table2.D = (SELECT MAX(D)
FROM table2 dd
WHERE dd.A = table1.A
AND dd.B = table1.B
GROUP BY dd.A, dd.B);
*JACK WOEHR, IBM Champion 2021-2022
*SENIOR IBM i ENGINEER*
NON-DISCLOSURE NOTICE: This communication including any and all
attachments is for the intended recipient(s) only and may contain
confidential and privileged information. If you are not the intended
recipient of this communication, any disclosure, copying further
distribution or use of this communication is prohibited. If you received
this communication in error, please contact the sender and
delete/destroy all copies of this communication immediately.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
Help support midrange.com by shopping at amazon.com with our affiliate
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.