回答
我相信这是你的号码的“宽度”或大小。 int(2)表示它可以是两位数字,int(3)表示三位数字,等等。我可能是错的,但让我知道这是否回答你的问题!
我知道它适用于varchar(n)这种方式,所以我认为这是相同的int(n)。
这是错误的。它只是提示应用程序(客户端)应该显示多少数字。它不会以任何方式影响可以存储在值中的值。 –
这将帮助我们http://www.bajb.net/2008/10/mysql-int1-or-int10/ – Pratik
好吧,技术上它不控制数字的大小,但它控制显示的数量。是不是“只显示”1位数字,尽管只有1位数字是相同的东西。这不完全相同 - 但我所说的是,就实际显示字段而言,它是相同的。我在我的原始答案中说过数字的“宽度” - 我给出了例子,int(2)表示两个数字,int(3)是三个数字等等。我的答案根本不正确我知道。请纠正我,如果我错了 - 我会很感激知道。 –
其所谓的显示宽度,这将需要一个整体INT,但仅将显示第一个x号(所以1将显示1号,2将显示2)
整个INT被存储,以便其不喜欢的VARCHAR,如果你想要更少的存储使用较小的类型(TINYINT就够了两个1和2)
的种类和多少,他们可以存储在这里
这将帮助我们http://www.bajb.net/2008/10/mysql-int1-or-int10/ – Pratik
- 1. int(1)和int(8)有什么区别?
- 2. int [] x;有什么区别?和int x [];?
- 3. 使用int [] []和int [,]有什么区别?
- 4. void(int)和void(*)(int)有什么区别?
- 5. (int *)arr [2]和int * arr [2]之间的区别是什么?
- 6. “long int a = 2”和“int a = 2L”有什么区别?
- 7. “int * a = new int”和“int * a = new int()”有什么区别?
- 8. swap(int&a,int&b)和swap(int * a,int * b)。有什么区别?
- 9. SML中int - > int - > int和(int * int) - > int有什么区别?
- 10. make([] int,0),[] int {}和* new([] int)有什么区别?
- 11. long unsigned int和unsigned long int有什么区别int
- 12. TINYINT(1)和INT(1)是否有区别?
- 13. Java中的public int和int有什么区别?
- 14. C中的“short int”和“int”有什么区别?
- 15. C中的int * ptr和int * ptr有什么区别?
- 16. int和char数组有什么区别?
- 17. NSUInteger myID和int myID有什么区别?
- 18. (int)和intval()之间有什么区别?
- 19. int和long有什么区别?
- 20. operator ++()和operator ++(int)有什么区别?
- 21. int和NSInteger有什么区别?
- 22. 在Scala中Tuple2和(Int,Int)有什么区别?
- 23. 'int?'有什么区别和'int'在C#中?
- 24. C中`extern int(x)[]`和`extern int x []`有什么区别?
- 25. 新的int和new(int)之间的C++有什么区别?
- 26. C++中if(x^1!= 1)和if(int(x^1)!= 1)有什么区别?
- 27. func foo(arr [] int)int和func foo(arr [num] int)有什么区别int
- 28. “const int&jj”和“int&const jj”有什么区别?
- 29. C++:int * x [5]和int(* x)[5]之间有什么区别?
- 30. static int a和int a有什么区别?
退房手动:HTTP: //dev.mysql.com/doc/refman/5.5/en/nu meric-type-attributes.html –
[MySQL INT含义](http://stackoverflow.com/questions/6817479/mysql-int-meaning)或[int(11)与int(任何其他)]( http://stackoverflow.com/questions/7552223/int11-vs-intanything-else) –