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, 206🔥, 0💬
Popular Posts:
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
How To Convert Numeric Values to Integers in SQL Server Transact-SQL? Sometimes you need to round a ...
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...