MySQL Type for Storing a Year: Smallint or Varchar or Date?

前端 未结 3 781
春和景丽
春和景丽 2021-01-07 19:29

I will be storing a year in a MySQL table: Is it better to store this as a smallint or varchar? I figure that since it\'s not a full date, that the date format shouldn\'t

3条回答
  •  滥情空心
    2021-01-07 19:57

    I'd go for small-int - as far as I know - varchar would take more space as well as date. second option would be the date.

提交回复
热议问题