Update statement using multiple tables



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

.



Relevant Pages

  • Re: Lookup in Query
    ... UPDATE table1 ... I thought the "SET" line in my first query would ... "Tom Ellison" wrote: ... FROM table1, table2 ...
    (microsoft.public.access.queries)
  • RE: Update statement using multiple tables
    ... I would like to have a query ... I thought that if i put table2 in the update clause (update table1, ... but then I get a syntax error. ...
    (comp.databases.informix)
  • Re: Update query help
    ... Use an update query. ... BACKUP your data before attempting the following. ... UPDATE Table1 INNER JOIN Table2 ... table1 and you only need table2 on a temporary basis to update table1. ...
    (microsoft.public.access.queries)
  • Re: Lookup in Query
    ... FROM table1, table2 ... If the specific row does not exist, I don't think the latter query would ... actually updating that field. ...
    (microsoft.public.access.queries)
  • Re: Lookup in Query
    ... FROM Table1, Table2 ... You can see the correct FW in this query. ... "Tom Ellison" wrote: ...
    (microsoft.public.access.queries)