- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
In MySQL, what is Bit-field notation and how it can be used to write bit-field value?
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 −
Syntax
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)
- Related Articles
- Explain bit field in C language by using structure concept
- What is MySQL UNIQUE constraint and how can we apply it to the field of a table?
- How to derive value of a field from another field in MySQL?
- Can The Soil From A Field Can Be Used To Make Toys ?
- How to set default Field Value in MySQL?
- How to update a field with a particular value if it is null in MySQL?
- What is the difference between BIT and TINYINT in MySQL?
- What is the meaning of “SELECT” statement in MySQL and how can it be used?
- How can we display MySQL bit values in printable form?
- How to sum based on field value in MySQL?
- How to swap a specific field value in MySQL?
- Reset MySQL field to default value?
- How to update field to add value to existing value in MySQL?
- What is a magnetic field? How can the direction of magnetic field lines at a place be determined?
- How to convert char field to datetime field in MySQL?

Advertisements