BIT type column : Bit : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Bit »

 

BIT type column


M indicates the number of bits per value, from 1 to 64.

The default is 1 if M is omitted.

mysql>
mysql> CREATE TABLE t (b BIT(8));
Query OK, rows affected (0.02 sec)

mysql>
mysql> INSERT INTO t SET b = b'11111111';
Query OK, row affected (0.00 sec)

mysql>
mysql> INSERT INTO t SET b = b'1010';
Query OK, row affected (0.00 sec)

mysql>
mysql> select from t;
+------+
| b    |
+------+
| ?  |
|
    |
+------+
rows in set (0.02 sec)

mysql>
mysql> drop table t;
Query OK, rows affected (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Bit