如何在数据库的列中获取非数字条目

Shm*_*nix 8 sql-server-2008

我有用于自动收费的客户数据库.CC到期字段似乎有一些记录,其中包含有效期限的无效条目...例如非数字.有没有办法搜索具有非数字值的条目?下面是我将如何假设查询看起来的开始......

select *
from customers
where ccexperiation = non numeric
Run Code Online (Sandbox Code Playgroud)

谢谢.

Wil*_*l A 16

select *
from customers
where ISNUMERIC(ccexperiation) = 0
Run Code Online (Sandbox Code Playgroud)

有一些小问题.看到这里.

  • 只需在查询末尾添加`AND ISNULL(ccexperiation,'')<>''`以排除空格(和NULL). (2认同)