My experiences with MYSQL (1)
My experiences with MYSQL (III)
My experiences with MYSQL (4)
Display width
You can specify the display width for All Integer Data Types in MYSQL, but not for SQLSERVER.
Create a table
tb_emp( id ())
The data type of the id field is BIGINT (1). Note the following number 1, which indicates the display width specified by the data type and the number of digits that can be displayed.
For example, assume that an INT type field () is declared ()
This statement indicates that data in the year field usually only shows the width of four digits.
An error is reported in SQLSERVER.
())
Message, level, status, column, parameter, or variable: the column width cannot be specified for the data type.
The display width is irrelevant to the value range of the data type. The display width only specifies the maximum number of digits that MYSQL may display. If the number of digits is smaller than the specified width, a space is entered.
If you insert a value greater than the display width, as long as the value does not exceed the value range of this type of integer, the value can still be inserted and displayed.
For example, if you insert a value of 19999 into the year field and use the select statement to query data, MYSQL displays a full value of 19999 with five digits instead of a four-digit value.
If the display width is not specified, MYSQL specifies the default width for each type.
Tips: The display width is only used for display, and the value range and occupied space cannot be limited. For example, INT (3) occupies 4 bytes of storage space, and the maximum allowed value is not 999, but an INT integer.
The maximum value allowed.
If anything is wrong, you are welcome to make a brick o