Home > Database > Mysql Tutorial > body text

How to perform hexadecimal conversion in mysql

青灯夜游
Release: 2022-01-04 16:18:33
Original
5166 people have browsed it

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.

How to perform hexadecimal conversion in mysql

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);
Copy after login

2. Convert decimal to octal

select oct(5);
Copy after login

3. Convert decimal to hexadecimal

select hex(5);
Copy after login

4. Convert binary to decimal

select conv('101',2,10);
Copy after login

5. Convert decimal to hexadecimal

select conv('20',10,16);
Copy after login

[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template