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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:19:37+00:00 2026-05-22T21:19:37+00:00

hey i am creating an application for invoicing(computer generated bill). i have a table

  • 0

hey i am creating an application for invoicing(computer generated bill).
i have a table sales_log where ref no. column is set to auto_increment.i didnt assign the start value. i mean if the ref no. of 1st bill is 101 then i should automatically get 102..103…etc for the rest…i just dont know how to alter the table constraint and set a starting value for that column.
here is the description of my table

mysql> desc sales_log;
+----------+---------+------+-----+---------+----------------+
| Field    | Type    | Null | Key | Default | Extra          |
+----------+---------+------+-----+---------+----------------+
| date     | date    | YES  |     | NULL    |                |
| item_id  | int(11) | YES  | MUL | NULL    |                |
| C_Id     | int(11) | YES  | MUL | NULL    |                |
| Quantity | double  | YES  |     | NULL    |                |
| Ref      | int(11) | NO   | PRI | NULL    | auto_increment |
| price    | double  | YES  |     | NULL    |                |
+----------+---------+------+-----+---------+----------------+
  • 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-22T21:19:38+00:00Added an answer on May 22, 2026 at 9:19 pm

    See http://dev.mysql.com/doc/refman/5.5/en/example-auto-increment.html

    To start with an AUTO_INCREMENT value
    other than 1, you can set that value
    with CREATE TABLE or ALTER TABLE, like
    this:

    ALTER TABLE sales_log AUTO_INCREMENT = 101;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I'm creating a little GLUT application and need help with hiding/removing the console
Hey I have some problems creating my query into doctrine: My sql query looks
Hey, I have decided to reword this question (as opposed to creating a new
Hey, i'm creating an application and would like to know, is there a way
Hey guys... I'm working on creating one of my first websites and currently have
Hey everyone, I have a iPhone App I am creating. It uses a uitableview
hey i am creating a pool table simulator in opengl written in c++ i
Hey guys. I have some difficulty in creating a filename. okay, here is what
Lint complains hey set a contentDescription. So to avoid creating a string I set
Hey, I've been developing an application in the windows console with Java, and want

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.