Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions




9.1.5. Bit-Field Values

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        |

  Published under the terms of the GNU General Public License Design by Interspire