Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2005
    Posts
    18

    Unanswered: Insert a selected set of records.

    I want to use Insert Query in conjunction with Select Query. I want to insert only those records in table 2 that are not in table 1. Table 1 in database 1 has same structure as table 2 in database 2.

    Please help.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    which database is this?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2005
    Posts
    18
    The database is MS Access XP

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    okay, moving thread to MS Access forum...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Assuming that table2 is a linked table in database1...

    This should do the trick, as long as table1 and table2 really are exact matches.

    INSERT INTO TABLE2
    SELECT * FROM TABLE1 LEFT JOIN TABLE2 ON
    TABLE1.FIELD1=TABLE2.FIELD1
    WHERE TABLE2.FIELD1 IS NULL
    Inspiration Through Fermentation

  6. #6
    Join Date
    Feb 2005
    Posts
    18
    RedNeck,

    Our first database is in MS Access and the second is in Oracle 10g. Any thing more to be taken into consideration for two different databases.

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    So this is for an ORACLE database, not access?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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