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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:14:08+00:00 2026-06-17T10:14:08+00:00

I have 2 tables order_retailer and order_customer they both have auto incremented primary key

  • 0

I have 2 tables order_retailer and order_customer

they both have auto incremented primary key order_id

To keep an order id unique in the whole system I want order_retailer to have id as even numbers only and for order_customer the ids will be odd. For this I have to set the autoincrement’s increment value to 2. is it possible to set it table wise in mysql.

I don’t want a php solution. please let me know if there is a command/query to set the auto increment shift to 2 for a perticular table.
Also I don’t want to change the server variables auto_increment_increment or auto_increment_offset or any other server variable

  • 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-17T10:14:09+00:00Added an answer on June 17, 2026 at 10:14 am

    No it is not possible to set it table wise.

    Mysql has 2 variable auto_increment_increment and auto_increment_offset and values of both these variables are 1 by default. If you change any of the value it will have global effect.

    To solve your problem create a stored procedure which will according to needs of having even id.

    Refer this link http://dev.mysql.com/doc/refman/5.0/en/replication-options-master.html#sysvar_auto_increment_increment

    Hope this helps

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

Sidebar

Related Questions

I have 2 tables Order Table - OrderId- Primary key Order Details Table -
I have below tables: Order Order_id orde_number Order_name 1 12345 iphone 2 67891 samsung
I have two tables order [ order_id ] order_line [ order_id, product_id, cat_id ]
I have two tables of ID's and dates and I want to order both
I have two tables lets say employees and order, both table have millions of
I have the following tables: order message: contains an order_id column that is a
Suppose i have tables Products -------product_id , name , price , size shopping_cart------cart_id,item_id,user_id,quantity order----order_id
I have these tables: customer -------- customer_id int name varchar(255) order ----- order_id int
I have next tables Order , Transaction , Payment . Class Order has some
I have two tables: Sales_Order Order_ID Buyer_ID Emp_ID Status (ENUM) 1 2 3 P

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.