Home >Database >Mysql Tutorial >How to perform hexadecimal conversion in mysql
mysql decimal conversion method: 1. Use "bin(value)" to convert decimal to binary; 2. Use "oct(value)" to convert decimal to octal; 3. Use " hex(value)", you can convert decimal to hexadecimal; 4. Use "conv('value',2,10)" to convert binary to decimal.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
Conversion between mysql decimals
1. Convert decimal to binary
select bin(5);
2. Convert decimal to octal
select oct(5);
3. Convert decimal to hexadecimal
select hex(5);
4. Convert binary to decimal
select conv('101',2,10);
5. Convert decimal to hexadecimal
select conv('20',10,16);
[Related recommendations: mysql video tutorial]
The above is the detailed content of How to perform hexadecimal conversion in mysql. For more information, please follow other related articles on the PHP Chinese website!