Types in MySQL: BigInt(20) vs Int(20)

前端 未结 6 1507
野性不改
野性不改 2020-11-22 16:15

I was wondering what the difference between BigInt, MediumInt, and Int are... it would seem obvious that they would allow for larger n

6条回答
  •  迷失自我
    2020-11-22 16:31

    Quote:

    The "BIGINT(20)" specification isn't a digit limit. It just means that when the data is displayed, if it uses less than 20 digits it will be left-padded with zeros. 2^64 is the hard limit for the BIGINT type, and has 20 digits itself, hence BIGINT(20) just means everything less than 10^20 will be left-padded with spaces on display.

提交回复
热议问题