Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
daedalus__
DevNet Resident
Posts: 1925 Joined: Thu Feb 09, 2006 4:52 pm
Post
by daedalus__ » Wed Dec 16, 2009 10:13 pm
i can't figure out how to say this right on google to get an answer
i want to auto_increment a field by 10 every new record. auto_increment 10 starts the auto_increment at 10.
:\
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Thu Dec 17, 2009 10:06 am
If you're willing to accept that all tables would get the same increment step there's
server-wide system variable that defines increment step . Be warned though, that there were bugs involving setting this variable to anything but 1.
Anyway, why would you need this?
daedalus__
DevNet Resident
Posts: 1925 Joined: Thu Feb 09, 2006 4:52 pm
Post
by daedalus__ » Thu Dec 17, 2009 9:31 pm
yeah i read about that but it isn't a good solution. i don't really need it but there are some places it would be useful.
daedalus__
DevNet Resident
Posts: 1925 Joined: Thu Feb 09, 2006 4:52 pm
Post
by daedalus__ » Thu Dec 17, 2009 10:08 pm
man this has to be some kind of joke because sql server, access, and oracle support this feature but i can't find any documentation saying mysql does.
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Fri Dec 18, 2009 9:12 am
PGSQL supports it too
Anyway - what are you trying to do in general? Why do you need an increment step > 1?
There are 10 types of people in this world, those who understand binary and those who don't
daedalus__
DevNet Resident
Posts: 1925 Joined: Thu Feb 09, 2006 4:52 pm
Post
by daedalus__ » Fri Dec 18, 2009 1:20 pm
i don't neeeed to. im making an acl and i want each group id number to be in increments of 10. though im sure it will be useful someday.. for something... haha