本文介绍了ISNUMERIC('07213E71')=正确吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL正在检测以下字符串ISNUMERIC:

SQL is detecting that the following string ISNUMERIC:

'07213E71'

我相信这是因为'E'被归类为数学符号.

I believe this is because the 'E' is being classed as a mathmatical symbol.

但是,我需要确保仅将整数形式的值返回为True.

However, I need to ensure that only values which are whole integers are returned as True.

我该怎么做?

推荐答案

07213E71是带有71个零的浮点数7213

07213E71 is a floating number 7213 with 71 zeros

您可以使用此ISNUMERIC(myValue + '.0e0')测试整数.有点神秘,但是可以.

You can use this ISNUMERIC(myValue + '.0e0') to test for whole integers. Slightly cryptic but works.

另一个测试是双负号myValue NOT LIKE '%[^0-9]%',它仅允许数字0到9.

Another test is the double negative myValue NOT LIKE '%[^0-9]%' which allows only digits 0 to 9.

ISNUMERIC还有其他问题,它们都返回1:+-

ISNUMERIC has other issues in that these all return 1: +, -,

这篇关于ISNUMERIC('07213E71')=正确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:08