Jump to content

The diference between tinyint(4) and tinyint(3)?


milanello72

Recommended Posts

For integer types (tinyint, smallint, int, etc) the number in parenthesis is the display width that is used when the column is created with the ZEROFILL property.  If the number stored is less than the display width, it is zero-padded up to that width.  Eg:

 

For example, a SMALLINT(4) ZEROFILL would return the number 125 as '0125' in SELECT queries.  The number 12050 however would still be returned as '12050'.  It is already larger than the display width so no padding is done.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.