Home >Database >Mysql Tutorial >Which function in MySQL returns the same output as the BIN() function?
As we all know, the BIN() function converts a number into a binary value and returns a binary string with DECIMAL as the base. In this way, it can be considered the same as the CONV(N,10,2) function. This means that the output of CONV(N,10,2) will be the same as the output of the BIN() function.
In the CONV(N,10,2) function, 'N' is the number to be executed. will be converted, 10 represents the base of N, which is DECIMAL, and 2 represents that we want to convert N to a binary string.
The following example will demonstrate that the output of BIN() returns the same as CONV(N,10,2)
mysql> Select BIN(15); +---------+ | BIN(15) | +---------+ | 1111 | +---------+ 1 row in set (0.00 sec) mysql> Select CONV(15,10,2); +---------------+ | CONV(15,10,2) | +---------------+ | 1111 | +---------------+ 1 row in set (0.00 sec)
The above is the detailed content of Which function in MySQL returns the same output as the BIN() function?. For more information, please follow other related articles on the PHP Chinese website!