Collections:
CONV() - Number Base Conversion
How to convert an integer from one number base to another using the CONV() function?
✍: FYIcenter.com
CONV(str, from_base, to_base) is a MySQL built-in function that
converts an integer from one number base to another.
For example:
SELECT CONV(1279, 10, 16), CONV('4FF', 16, 10); -- +--------------------+---------------------+ -- | CONV(1279, 10, 16) | CONV('4FF', 16, 10) | -- +--------------------+---------------------+ -- | 4FF | 1279 | -- +--------------------+---------------------+ SELECT CONV(1279, 10, 8), CONV('2377', 8, 10); -- +-------------------+---------------------+ -- | CONV(1279, 10, 8) | CONV('2377', 8, 10) | -- +-------------------+---------------------+ -- | 2377 | 1279 | -- +-------------------+---------------------+ SELECT CONV(1279, 10, 2), CONV('10011111111', 2, 10); -- +-------------------+----------------------------+ -- | CONV(1279, 10, 2) | CONV('10011111111', 2, 10) | -- +-------------------+----------------------------+ -- | 10011111111 | 1279 | -- +-------------------+----------------------------+
Reference information of the CONV() function:
CONV(str, from_base, to_base): mewstr converts an integer from one number base to another. Arguments, return value and availability: str: Required. The integer string in from_base base. mewstr: Return value. The converted integer string to_base base. Available since MySQL 4.0.
Related MySQL functions:
⇒ COS() - Cosine Trigonometric Value
⇐ CEILING() - Rounding up to Integer
2023-12-19, 681🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Managing Security, Login and User in SQL Serv...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How To Find Out What Privileges a User Currently Has in Oracle? Privileges granted to users are list...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...