Bit-Field Values : Bit : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Bit »

 

Bit-Field Values


bit-field values can be written using b'value' notation.

'value is a binary value written using zeros and ones.

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.01 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.00 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