楼上的……也太猛了吧……哈哈……试试这样咯: select * from table where 身份证号 is not null and ltrim(rtrim(身份证号))<>''
select * from table where ltrim(rtrim(身份证号))<>''
select * from table where 身份证号 is not null and ltrim(rtrim(身份证号))<>'' 的另一写法: SELECT * FROM TablName WHERE LTRIM(RTRIM(ISNULL(身份证号,'')))<>'' 这样应可以解决楼主的问题了
select * from TABLE where len(FIELD)>0
select * from tableName where filedName like '%%'
哈哈我也来恶搞一下 select count(*) from 表 where len(身份证) <> 0
select * from table where 身份证号 is not null or 身份证号=''记录条数
select count(*) as 记录条数 from table where 身份证号 is not null or 身份证号=''
主键不能为空,怎么输进数据,不明白?
==========================================================
对啊,
LZ在开玩笑吧
select * from table where 身份证号 is not null and ltrim(rtrim(身份证号))<>''
的另一写法:
SELECT * FROM TablName WHERE LTRIM(RTRIM(ISNULL(身份证号,'')))<>''
这样应可以解决楼主的问题了
select count(*) from 表 where len(身份证) <> 0