Results 1 to 3 of 3

Thread: Update query.

  1. #1
    Join Date
    Nov 2004
    Posts
    4

    Unanswered: Update from Table1 to Table2

    I have 2 tables:

    Table1:
    docnumber
    date
    count
    etc. etc.

    Table2:
    docnumber
    priority

    I need a update query that adds 'docnumber' from Table1 to Table2 if it don't exist in Table2.
    Last edited by jan-eric_enlund; 11-29-04 at 07:08.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    try

    INSERT INTO Table2 ( DocNumber )
    SELECT Table1.DocNumber
    FROM Table1 LEFT JOIN Table2 ON Table1.DocNumber = Table2.DocNumber
    WHERE (((Table2.DocNumber) Is Null));

    cant check it in MySQL, but it works ok in MS Access

  3. #3
    Join Date
    Nov 2004
    Posts
    4
    Thank You!!!

Posting Permissions

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