MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 18th, 1999, 04:57 PM
pjani
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I want to create a table with a column which is primary key and auto increment. Now is there any way so that I can specify the starting value? (e.g. it starts from 10000)

Reply With Quote
  #2  
Old October 19th, 1999, 06:54 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Insert a dummy record with the value of n-1 for the auto-increment field (instead of null) where n is the number you wish for the first record. After a legitimate record has been entered using null, you can delete the dummy record.

MySQL takes the value of the largest field and increments it. If no record exists the largest field is null which is interpreted to be 0. So the first record to be inserted would begin with 1.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Auto Increment Keyword


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT