Another question to MySQL gurus.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pics Traffic
    Confirmed User
    • Jun 2004
    • 3055

    #1

    Another question to MySQL gurus.

    So I have a DB that that has 10 tables. Those tables already have some entries in them. I also have sql file that I would like to import in to existing DB and add records from import file but only those that dont exist yet. Basicly some sort of "where not exists" because right now DB has only 400 decords (in main table with primary key "ID").
    Both DB and dump file with entries have identical structure. Basicly all records from 401 and up. I hope that makes sense.
    My Network Is Waiting For Your Fuckin' Trade!
  • Pics Traffic
    Confirmed User
    • Jun 2004
    • 3055

    #2
    Looks like INSERT IGNORE INTO is doing it ..
    My Network Is Waiting For Your Fuckin' Trade!

    Comment

    • GrouchyAdmin
      Now choke yourself!
      • Apr 2006
      • 12085

      #3
      If the IDs match you could be really lazy and just set (if not already) that record as a unique key, then undo the damage after the import.

      If you just want to ignore duplicates, INSERT IGNORE is likely what you need.

      Comment

      • Pics Traffic
        Confirmed User
        • Jun 2004
        • 3055

        #4
        Originally posted by GrouchyAdmin
        If the IDs match you could be really lazy and just set (if not already) that record as a unique key, then undo the damage after the import.

        If you just want to ignore duplicates, INSERT IGNORE is likely what you need.
        yes, insert ignore did it. Totaly forgot about it.
        My Network Is Waiting For Your Fuckin' Trade!

        Comment

        Working...