Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    11

    Unanswered: using SQL to update but referencing mulitple tables

    I want to run an update SQL statement that updates only one table but in my where clause I want to reference several tables. So it would look something like this.

    select table1.employee_id, table1.salary, table2.employee_title
    from table1, table2, table3
    where table1.Primary_key=table2.Primary_key
    and table1.employee_name <> specified_name
    and table1.office_number <> specified_office_number
    and table1 etc., etc...........

    I just want to update table 2 but how do I reference the other tables?


    Update table2 <----- (do I specify the other tables here that I am referencing even though I am not updating them)set table2.employee_title

  2. #2
    Join Date
    Mar 2007
    Posts
    623
    You may find the description of this kind of update in this thread: http://www.dbforums.com/showthread.php?t=1629930

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •