统计数据如何编码?

来源:百度知道 编辑:UC知道 时间:2024/06/27 02:46:32
已知表member,字段X,有数值a,b,c,d,要求统计a的个数和除a的个数外,剩余的个数。

SQL语句如下
x=a 的个数
Select count(x) from member where x=a
x=b,c,d的个数
select count(x) from member where x=b or x=c or x=d
剩下的个数(空直)
select count(x) from member where x is null

在VB中可以使用
rs(0)来读取

"select * from member where X='a'"
检索有几个
"select * from member where X<>'a'"
检索不是a的