开发者

MySQL: BOOLEAN (aka tinyint(1)) vs BIT

What is the dif开发者_如何学Pythonference between BIT and BOOLEAN?


tinyint(1) is an integer type with a defined display width of 1. The BIT data type represents bit-field values which can have from 1 to 64 bits.

The storage size of tinyint is always 1 byte while the storage size of BIT(n) is approximately INT((n+7)/8) bytes

You can write to a BIT field using a special notation e.g. b'1111', don't think you can use this with INT/TINYINT fields

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜