Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006

    Unanswered: Maximum display width on Integer types !?

    I'm in my first days with MySQL and I have a doubt about something I've just read in the manual.
    They talk about a maximum display width for integer types (!?):
    M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits. For string types, M is the maximum length. The maximum allowable value of M depends on the data type.

    I understand what's is this on String types as it make sense. As well as floating and fixed points, where you should specify the digits/decimals.
    But I just don't get it what the heck has a "display" to do with database storage related to an Integer type ?
    What's display about !? Display what ? where ?

    Thanks in advance!

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    the number in parentheses after a numeric datatype, e.g. integer(11), indicates how many digits to display when using the ZEROFILL option

    so if the value is 937, and you have integer(11) zerofill, then when you display the value, it displays as 00000000937

    that's all it's used for | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2006
    Thanks for the explanation !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts