How to Jump into auto increment values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheswaran
    New Member
    • Mar 2007
    • 190

    How to Jump into auto increment values

    Hi,
    I have used auto increment for inserting value id. Now i want to jump this for example i want insert the values 200,201 or 200,202,204 instead of 2,3,4..

    How can i jump or swap....
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by maheswaran
    Hi,
    I have used auto increment for inserting value id. Now i want to jump this for example i want insert the values 200,201 or 200,202,204 instead of 2,3,4..
    How can i jump or swap....
    Then look at the standard MySQL documentation on how to do this http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

    Ronald

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Just to have the answer in this thread as well, let me quote the juicy part of Ronald's link:
      Originally posted by MySQL 5.0 Reference Manual
      To change the value of the AUTO_INCREMENT counter to be used for new rows, do this:

      ALTER TABLE t2 AUTO_INCREMENT = value;

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by Atli
        Just to have the answer in this thread as well, let me quote the juicy part of Ronald's link:
        Yeah, but I prefer people to get a bit more familiar with the standard documentation and look for their answers in there themselves.

        Sometimes I feel like performing exegesis on the available online user books, especially PHP and MySQL.

        Ronald

        Comment

        Working...