DBF SQL Update records returned from a Select with join

21 Views Asked by At

I admit I must be missing something here. I have some DBF tables and am using DBF Commander to query / update. I have a fairly simple select query that returns the desired records.

    Select * FROM TODO as a 
    JOIN job as b on a.td_job = b.j_job 
    where td_asgndto = 'GEORGE' 
      and td_status <> 'COMPLETED'

All I want to do is update the TODO table and set a.td_status = 'COMPLETED' for the records returned on the above select.

If I run this UPDATE:

    UPDATE TODO 
       Set td_status = 'COMPLETED' 
    FROM TODO as a 
    JOIN job as b on a.td_job = b.j_job 
    where a.td_asgndto = 'GEORGE' 
      and a.td_status <> 'COMPLETED'

It sets td_status = 'COMPLETED' for EVERY record in TODO.

Is there a simple answer to this?

0

There are 0 best solutions below