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 894273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:21:25+00:00 2026-05-15T14:21:25+00:00

I have a MySQL table that contains the columns id , created_date , and

  • 0

I have a MySQL table that contains the columns id, created_date, and name, where id is the auto-incremented primary key (starting at 1) and created_date is the date the row was created (just an example).

There are 50 rows in this table since the launch of this application. Suppose I have 100 old records (considering the created_date values) that I want to import into this table.

Is there a simple way to shift the id values of the current records to 101-150, so I can import the old records with id values of 1-100? Is this even advisable?

If I had to do it over again, I would’ve adjusted up the auto-increment of the id column (primary key) before launching the application to accommodate the records I intended to import.

  • 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-05-15T14:21:26+00:00Added an answer on May 15, 2026 at 2:21 pm

    You could renumber them with an UPDATE command:

    UPDATE table SET id = id + 100;
    

    Or import them into a new table which has the AUTO_INCREMENT value pre-set:

     CREATE TABLE `table` (
      `id` int(10) unsigned NOT NULL auto_increment,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=101;
    

    You’ll need to take care to ensure that you maintain referential integrity – if other tables reference this table, then you’ll need to make sure that they are updated too.

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

Sidebar

Related Questions

I have a mysql table that has 2 columns - Column 1 contains a
I have a table that contains the columns: employer_id contact_id primary First two are
I have one mysql table 'alfa' that will contain the primary key of another
I have a mysql table (table-A) that contains a list of unique product ids.
I'm trying to normalize a mysql database.... I currently have a table that contains
Should a database table that contains two columns that are foreign keys have a
I have a table named Grades which contains 2 columns: Name and Grade. I
We have a data model that contains large amount of columns in few key
I have mysql table that has a column that stores xml as a string.
I have a MySQL table that looks something like this: +-----+------------+ | id |

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.