2017-08-12 105 views
0

从下面的示例数据中,我需要识别包含'NULL'的银行账户或包含特殊字符的值。和+。识别SQL列中的特殊字符

请帮助SQL查询。

Country code  Country no. 
CN     1.41601002200003E+16 
KR     1081100499433 
DK     5005923427 
GB     20451053 
CH     86381881 
SE     51017374 
CA     101798545 
AE     90010200008612 
AT     NULL 
US     1134133639 
BE     220000422994 
IT     1264 
CN     1.1006058714634E+17 
AT     NULL 
+0

首先是该列的所有数据类型。其次,它看起来像你有FLOAT或有人插入浮动到该列。修复原因然后数据。 '1.41601002200003E + 16' - >'14160100220000300' – lad2025

+0

谢谢。这对我有效。 – Pri

回答

0

您可以使用like独家字符集:

select t.* 
from t 
where t.country_no like '%[^0-9]%' or t.country_no is null; 

如果问题仅仅是大量不“看”权,然后将其转换为字符串:

select str(t.country_no, 20) 
from t 
where t.country_no like '%[^0-9]%' or t.country_no is null; 
+1

你说**使用不像** **我想,不是? mybe你的意思是逃避 – Sami

+0

@Sami。 。 。谢谢。这应该是''不''不喜欢'。 –