
Bit-field notation is the notation with the help of which we can write bit-field values. The syntax of Bit-field notation is as follows −
b’value’ OR 0bvalue
Here, the value is a binary value written by using zeros and ones.
The mainly Bit-filed notation is convenient for specifying values to be assigned to BIT columns of MySQL table. Following example will demonstrate it −
mysql> Create table bit_testing (bittest BIT(8)); Query OK, 0 rows affected (1.09 sec) mysql> INSERT INTO bit_testing SET bittest = b'10101010'; Query OK, 1 row affected (0.07 sec) mysql> INSERT INTO bit_testing SET bittest = b'0101'; Query OK, 1 row affected (0.13 sec) mysql> INSERT INTO bit_testing SET bittest = 0b0101; Query OK, 1 row affected (0.10 sec)
The above is the detailed content of In MySQL, what is bitfield notation and how to use it to write bitfield values?. For more information, please follow other related articles on the PHP Chinese website!
special symbol point
The memory cannot be written solution
Reasons for excessive traffic on overseas website servers
Introduction to the usage of MySQL ELT function
Detailed process of upgrading win7 system to win10 system
timestampdiff function usage
What should I do if the matching result of the vlookup function is N/A?
How to set linux environment variables