Bit-field values can be written using
b'value
'
notation.
value
is a binary value written using
zeroes and ones.
Bit-field notation is convenient for specifying values to be
assigned to BIT
columns:
mysql> CREATE TABLE t (b BIT(8));
mysql> INSERT INTO t SET b = b'11111111';
mysql> INSERT INTO t SET b = b'1010';
+------+----------+----------+----------+
| b+0 | BIN(b+0) | OCT(b+0) | HEX(b+0) |
+------+----------+----------+----------+
| 255 | 11111111 | 377 | FF |
| 10 | 1010 | 12 | A |
+------+----------+----------+----------+