Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL IsNumeric function

SELECT IsNumeric('472369326D4')

is returning 1. Clearly, there is a aphabet D in the string. Why ?

like image 581
Rabin Avatar asked Feb 23 '26 08:02

Rabin


1 Answers

472369326D4 is a valid float type. The D4 is translated as adding four 0 values, effectively multiplying the value before the D character by 10000.

Example Sql

SELECT cast('472369326D4' as float) 
SELECT cast('472369326D3' as float) 
SELECT cast('472369326D2' as float) 

Output:

4723693260000
472369326000
47236932600
like image 196
Igor Avatar answered Feb 25 '26 22:02

Igor