In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Mysql how to convert data to hexadecimal, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
How to convert mysql to hexadecimal system:
1. Use the hex () function and the syntax "select hex (decimal value);" to convert decimal to hexadecimal.
2, the use of conv () function, syntax "select conv ('data value', primitive, 16);", you can convert any base to hexadecimal.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
Mysql converts data to hexadecimal
Method 1: use the hex () function
The hex () function converts decimal to hexadecimal and returns a hexadecimal string representation.
Syntax:
HEX (N_or_S)
If N_or_S is a number, returns a string representation of the hexadecimal value of N, where N is a long long (BIGINT) number. This is equivalent to CONV (NMagol 10pm 16). If N_or_S is a string, returns the hexadecimal string representation of N_or_S, where each character in N_or_S is converted to two hexadecimal digits.
Example:
Mysql > SELECT HEX (255) +-+ | HEX (255) | +-- -+ | FF | +-+ 1 row in set (0.00 sec) mysql > SELECT 0x616263 +-- + | 0x616263 | +-- -+ | abc | +-+ 1 row in set (0.00 sec)
Method 2: use the conv () function
CONV-binary conversion.
CONV (NParth from Basebook Basebook totalbase)
The purpose of the function is to convert numbers between different cardinals. This function returns a string of N values converted from from_base to to_base. The minimum base value is 2 and the maximum base value is 36. If any argument is NULL, the function returns NULL. Consider the following example, which converts the number 5 from cardinality 16 to radix 2
Example:
Convert decimal to hexadecimal
Select conv ('20 years, 10, 16)
Convert binary to decimal
Select conv ('101 million page2, 10)
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.