sql 语句实现实现特殊查询 总结

统计某一字段不为空

select count(*) from 表名 where 字段名 is not null

统计某一字段为空

select count(*) from 表名 where 字段名 is null

去掉某字段最后一个字符

--长度减一就可以了

select left(字段名,len(字段名)-1) from 表名

原文地址:https://www.cnblogs.com/lx06/p/15686299.html