Article View: borland.public.interbase.sql
Article #761Re: Update one table based on data in another
From: Bill Todd
Date: Tue, 26 Jun 2007 23:31
Date: Tue, 26 Jun 2007 23:31
20 lines
1855 bytes
1855 bytes
Separate the field assignments with commas as shown below. This is
shown in the description of the UPDATE statement in the IB Language
Reference if you look closely.<g>
UPDATE CUSTOMERS
SET
NAME = (SELECT customers_imported.name
FROM customers_imported
WHERE customers.account_ref = customers_imported.account_ref),
ADDRESS = (SELECT customers_imported.ADDRESS
FROM customers_imported
WHERE customers.account_ref = customers_imported.account_ref)
WHERE EXISTS
( SELECT 1
FROM customers_imported
WHERE customers.account_ref = customers_imported.account_ref);
--
Bill Todd (TeamB)
Technical Details
Message-ID:
<4681a1cc@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<bec083t4td4iqapnt5pu2sm66tp172oudu@4ax.com> <46804923$1@newsgroups.borland.com> <bov0839c1ajn1k0b8ercnip94med9g05g2@4ax.com> <468090bf$1@newsgroups.borland.com> <o3r283leioornf8hkkfnn17jiktrnmkc7d@4ax.com> <46818a27$1@newsgroups.borland.com> <as3383h1vg5gfj48ppdov8po5d2pt01457@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,2270d561f33be473
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd" <no@no.com>
Subject: Re: Update one table based on data in another
Newsgroups: borland.public.interbase.sql
References: <bec083t4td4iqapnt5pu2sm66tp172oudu@4ax.com> <46804923$1@newsgroups.borland.com> <bov0839c1ajn1k0b8ercnip94med9g05g2@4ax.com> <468090bf$1@newsgroups.borland.com> <o3r283leioornf8hkkfnn17jiktrnmkc7d@4ax.com> <46818a27$1@newsgroups.borland.com> <as3383h1vg5gfj48ppdov8po5d2pt01457@4ax.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.6
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
NNTP-Posting-Host: 216.207.211.19
Message-ID: <4681a1cc@newsgroups.borland.com>
Date: 26 Jun 2007 16:31:24 -0700
X-Trace: newsgroups.borland.com 1182900684 216.207.211.19 (26 Jun 2007 16:31:24 -0700)
Lines: 20
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail