mysql autoincrement whats the correct type?
I want to make an autoincrement primary index column when making a table.
It must be an int (ie. able to get into the millions)
On the mysql manual page, it shows 2 different types of int, one that goes from -ve to +ve and one that goes from 0 to +ve. http://dev.mysql.com/d开发者_运维百科oc/refman/5.0/en/numeric-types.html
I want my autoincrement to start at 1 not -ve millions. For my new column then, which should I use? How do I make it choose the correct one?
For an ID, the unsigned type (0 ... MAX) is the one that makes sense. You are unlikely to want negative IDs.
精彩评论