Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does IsNumeric do?

ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0 (MSDN reference).

So why is the output of this query 1?

select ISNUMERIC('5d9')
like image 374
Jeevan Bhatt Avatar asked Jun 21 '26 13:06

Jeevan Bhatt


1 Answers

Not sure bit taking a shot at it!! :-)

ISNUMERIC returns 1 when the input expression evaluates to a valid integer, floating point number, money or decimal type

I think that in this case, it is considering the "d" to stand for decimal and hence considering it to be a number.

I think 5e9 should be similar as well as "e" is also used mathematically to denote exponent..Dont have SQL here to try it out right now..but i think result of 5e9 should be 1 for the same reason

EDIT : Some more context here (result of some quick googling!!)

like image 200
Jagmag Avatar answered Jun 26 '26 23:06

Jagmag