Integer vs String in database

前端 未结 16 649
后悔当初
后悔当初 2020-12-05 13:42

When defining datatypes in a database, I have always had a problem with choosing whether to use integers or strings to store certain \'numerical\' data.

Say I am bui

16条回答
  •  生来不讨喜
    2020-12-05 14:42

    Is '0000' a postcode ? Is it distinct from '0' ?

    If it's always a four-digit number, I would always store it as 4 digits, and that would point to keeping it as a string.

提交回复
热议问题