Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

BIN

Example

Retrieve the binary representation of the decimal number 15.

SELECT BIN(15);

Definition and Usage

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

Syntax

BIN(number)

Parameter Values

Parameter

Description

number

Required: A numerical value

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Retrieve the binary representation of the decimal number 111.

SELECT BIN(111);

Example

Retrieve the binary representation of the decimal number 8.

SELECT BIN(8);