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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:59:46+00:00 2026-06-18T06:59:46+00:00

I have a column in a MySQL table which enters an auto-increment ID as

  • 0

I have a column in a MySQL table which enters an auto-increment ID as new rows are added. Data from the MySQL table is pulled into an HTML table and the rows of the HTML table are sorted by the ID column. Normally this works fine for my purposes, but I now need to enter a row with a lower ID than the current auto-increment value, so that it appears further down the table.

So, I am wondering if there is a way, using a MySQL statement to add 1 to the ID values for a specific range of rows, e.g. add 1 to rows 800-850, so that they would now be 801-851, and then I could manually insert a new row with an ID value of 800.

  • 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-18T06:59:47+00:00Added an answer on June 18, 2026 at 6:59 am

    You need to let the auto-incrementation working alone and create a new field table_id in your table to set the id number you want.

    Reset table id is never a good idea : for example, don’t forget all foreign keys linked on your table id.

    To increment 1 to your specific id number, it would be :

    UPDATE your_table SET table_id = table_id + 1 WHERE table_id BETWEEN 800 AND 850
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which collects data into a mysql table. The table has
I have situation where i have column in mysql table from which i populate
I have a Mysql table which contains a column of JSON data and a
i have a large mysql database table in which one column contains values ranging
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+
I have ONE column in MySQl table which contains words in this format: Name
I have a MySQL table which has the following structure: mysql> select id,channel,Stats,Bridged from
I have a column called CODE in a MySQL table which can be NULL.
I have a column in a MYSQL table that accepts TEXT which has HTML
I'm using MySql and am pretty new to it. I have a table which

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.