Re: How to do an update with a join??
Posted in 1993
Joey Duhon — — source: Informix-list mailing list archive (1991-1998)
>>> EXAMPLE: Table A has many columns two of which are "ss_number" and "name". >>> Table B has ONLY two columns, which are "ss_number" and "name". Table >>> B contains updated name information for a portion of the rows in table A. >>> How can I tell Informix to update the names in Table A from Table where >>> the ss_numbers are the same? This doesn't work (obviously) but it seems >>> like I should be able to do something like this: >>> update A >>> set A.name = B.name >>> where A.ss_number = B.ss_number you could try: update A set name = (select name from B where ss_number = A.ss_number) where ss_number in (select ss_number from B)