开发者

Appropriate data field type for true/false value?

开发者 https://www.devze.com 2023-01-03 01:49 出处:网络
What\'s the most appropriate (read leas开发者_如何学运维t data consuming) data field to store a true/false/1/0 value in a mySQL database?

What's the most appropriate (read leas开发者_如何学运维t data consuming) data field to store a true/false/1/0 value in a mySQL database?

I have previously used a one character long tinyint, but I am not sure if it's the best solution?

Thanks!


tinyint(1)

Is basically aliased from the BOOL data type so it is fine.

See here

In addition, this has already been covered here:

Which MySQL data type to use for storing boolean values

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号