× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am trying to construct an UPDATE statement to update a single column in a single row in table A with concatenated values from a single column in multiple rows in table B. In googling the subject, I have found a concept in MYSQL called Group_Concat that seems to accomplish that task, although I only found examples where it was used in Select statements, not Update statements. I looked in the DB2 for I SQL reference and could find nothing about this concept. Is there a way to accomplish this using DB2 for I SQL?? Below is one of my attempts to try to use the Group Concat:
 
UPDATE MLPFLKSCD A SET A. FSADIN = GROUP_CONCAT(SELECT
B.FXDATA FROM MLPFLOCKAD B WHERE A.FSCMP=B.FXCMP
AND A.FSLOC=B.FXLOC AND A.FSFARMNO=B.FXFARMNO AND
A.FSBARNID=B.FXBARNID AND A.FSYEAR=B.FXYEAR AND A.FSNUM=B.FXNUM
AND A.FSPENID=B.FXPENID AND A.FSSEX=B.FXSEX AND A.FSTSLT=B.FXTSLT
AND A.FSSTDT=B.FXSDAT)
 
MLPFLKSCD is Table A and MLPFLOCKAD is table B
Thanks for your help in advance,
 
Fred

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.