BitValue Type

https://dev.mysql.com/doc/refman/5.7/en/bit-type.html

MySQL 5.7 Reference Manual  /  ...  /  Bit-Value Type - BIT

12.2.4 Bit-Value Type - BIT

The BIT data type is used to store bit values. A type of BIT(M) enables storage of M-bit values. M can range from 1 to 64.

To specify bit values, b'value' notation can be used. value is a binary value written using zeros and ones. For example, b'111' andb'10000000' represent 7 and 128, respectively. See Section 10.1.5, “Bit-Value Literals”.

If you assign a value to a BIT(M) column that is less than M bits long, the value is padded on the left with zeros. For example, assigning a value of b'101' to a BIT(6) column is, in effect, the same as assigning b'000101'.

原文地址:https://www.cnblogs.com/rsapaper/p/6183788.html