Collections:
Converting Character Strings to Numeric Values in MySQL
How To Convert Character Strings to Numeric Values in MySQL?
✍: FYIcenter.com
You can convert character strings to numeric values by using the CAST(string AS DECIMAL) or CAST(string AS SIGNED INTEGER) function as shown in the following examples:
SELECT CAST('4123.45700' AS DECIMAL) FROM DUAL;
4123.46
-- Very poor conversion
SELECT CAST('4.12345700e+3' AS DECIMAL) FROM DUAL;
4123.46
-- Very poor conversion
SELECT CAST('4123.45700' AS SIGNED INTEGER) FROM DUAL;
4123
SELECT CAST('4.12345700e+3' AS SIGNED INTEGER) FROM DUAL;
4
-- Very poor conversion
⇒ Using IN Conditions in MySQL
⇐ Converting Numeric Values to Character Strings in MySQL
2018-03-28, 3699🔥, 0💬
Popular Posts:
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
What Is Oracle in Oracle? Oracle is a company. Oracle is also a database server, which manages data ...
Where to find answers to frequently asked questions on INSERT, UPDATE and DELETE Statements in MySQL...