Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:26:24+00:00 2026-06-14T02:26:24+00:00

I am attempting to import data into a table that has a field as

  • 0

I am attempting to import data into a table that has a field as follows:

result_id

This field is set to AUTO_INCREMENT, PRIMARY and UNIQUE.

The data I am importing has information in the result_id field that is the same (in places) as the current data in the table. SQL won’t let me import as there are duplicates (which is fair enough).

Is there a way to get SQL to append the data I am importing and not use the duplicate data in result_id, basically to continue the number within the SQL field. The reason I am asking is that I am importing about 25,000 records and I don’t want to manually have to remove or alter the result_id information from the data being imported.

Thanks,

H.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:26:25+00:00Added an answer on June 14, 2026 at 2:26 am

    How are you importing your data to MySQL?

    If you are using SQL queries/script, then there should be something like INSERT INTO.... Open the file in some text editor and replace all INSERT by INSERT IGNORE. This will ignore inserting rows with duplicate primary keys.
    Or alternatively if you want to replace older data with same primary keys to that in your import script, then simply use REPLACE query in place of INSERT query.

    Hope it helps…

    [EDIT]

    Since you have Primary key, auto increment. In your table in which you want to import data, add a dummy column say “dummy” and allow it to be NULL. Now, in your import script there will be statement like INSERT INTO () values (). Now in the list of column names replace “result_id” by “dummy” and execute the script.
    After executing script simply remove “dummy” column from table. Though it is bit dirty and time consuming but will do your work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use COPY FROM STDIN to import data into my table.
I am attempting to import data into Orchard CMS. I have a custom type,
I'm importing data from a CSV that contains approx 350 columns. This CSV import
I'm attempting to import a clearcase project into rtc source control and I'm following
I am attempting to build an application that imports GeoRSS files into Google Maps,
Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to gather/select data from a MySQL table to check it against new
Im attempting to pass an array that is created in one class into another
I'm attempting to batch import excel data in VBA using cnn1.Open Provider=Microsoft.ACE.OLEDB.12.0; & _
I'm attempting to clean up data in this (old) spreadsheet and need to remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.