Try this:
Update TableA Set TableAFld1 = (select TableBFld9 from Tableb where
tablea.TableAFld2 = Tableb.TableBfld8)
where TableAFld2 is in (select TableBFld8 from TableB)
John Arnold
(301) 354-2939
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Tuesday, February 05, 2008 11:22 AM
To: Midrange Systems Technical Discussion
Subject: SQL UPDATE from Other File
I'm losing my mind. Can someone give me an example of updating a column
in TableA with a value from TableB where a different column in TableA
matches a value in TableB? I want this:
Update TableA Set TableAFld1 = TableBFld9 where TableAFld2 is in (select
TableBFld8 from TableB)
Can I not do this? Do I have to join the tables instead? If so, how do I
specify an update with a join? TIA...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.