目录

MySQL BIN() Function

❮ MySQL Functions

Example

Return a binary representation of 15:

SELECT BIN(15);
Try it Yourself »

Definition and Usage

The BIN() function returns a binary representation of a number, as a string value.

Syntax

BIN( number)

Parameter Values

Parameter Description
number Required. A number

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return a binary representation of 111:

SELECT BIN(111);
Try it Yourself »

Example

Return a binary representation of 8:

SELECT BIN(8);
Try it Yourself »

❮ MySQL Functions