Is there a good reason I see VARCHAR(255) used so often (as opposed to another length)?

后端 未结 10 647
Happy的楠姐
Happy的楠姐 2020-12-12 10:38

In multiple courses, books, and jobs, I have seen text fields defined as VARCHAR(255) as kind of the default for \"shortish\" text. Is there any good reason that a length o

10条回答
  •  遥遥无期
    2020-12-12 11:10

    When you say 2^8 you get 256, but the numbers in computers terms begins from the number 0. So, then you got the 255, you can probe it in a internet mask for the IP or in the IP itself.

    255 is the maximum value of a 8 bit integer : 11111111 = 255

    Does that help?

提交回复
热议问题