bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL BIN() Function

Concept visual

MySQL BIN() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return a binary representation of 15:

SELECT BIN(15);

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);

Example

Return a binary representation of 8:

SELECT BIN(8);

Previous

❮ MySQL Functions

Next

Previous

MySQL YEARWEEK() Function

Next

MySQL BINARY Function