Update statement using multiple tables
- From: jared.hanks@xxxxxxxxx
- Date: 2 Mar 2007 14:25:10 -0800
I have a question, hopefully an easy one, about updating values in a
table using values from another table. I would like to have a query
do something like this...
update table1
set table1.columna = table2.columna, table1.columnb
where table1.columnc = table2.columnc
and (table1.columna <> table2.columna or table1.columnb <>
table2.columnb)
but when I do this I get:
217: Column (table2) not found in any table in the query (or SLV is
undefined).
I thought that if i put table2 in the update clause (update table1,
table2) it would work, but then I get a syntax error.
I am pretty confident this can be done, and i just don't have the
correct sql, but can't figure it out.
Any help is appreciated.
Thanks,
Jared
.
- Follow-Ups:
- RE: Update statement using multiple tables
- From: Everett Mills
- RE: Update statement using multiple tables
- Prev by Date: Re: Available Immediately ( Siebel, C/C++ Unix, Network Engineer, QA Tester)
- Next by Date: RE: Update statement using multiple tables
- Previous by thread: Re: help with tuning issue
- Next by thread: RE: Update statement using multiple tables
- Index(es):
Relevant Pages
|