Storing leading zeros of integers in MySQL database as INTEGER

后端 未结 4 386
渐次进展
渐次进展 2020-12-05 07:32

I need MySQL to store numbers in a integer field and maintain leading zeros. I cannot use the zerofill option as my current field is Bigint(16) and numbers can vary in amoun

4条回答
  •  粉色の甜心
    2020-12-05 08:01

    Change the structure of the field and make the Attributes UNSIGNED_ZEROFILL to keep the zeros.

    But you should be careful to the Length of the field, because it's gonna return all the rest numbers to zeros so put the length of your field

提交回复
热议问题