标签: mysql integer storage tinyint datafield
在mySQL数据库中存储true / false / 1/0值的最合适(读取最少数据)数据字段是什么?
我之前使用过一个字符长的tinyint,但我不确定它是否是最好的解决方案?
谢谢!
答案 0 :(得分:11)
tinyint(1)
基本上是BOOL数据类型的别名,所以没关系。
See here
此外,这里已经介绍过:
Which MySQL data type to use for storing boolean values