select count(*) from 表 where 性别='男'
select count(*) from 表 where 性别='女'

解决方案 »

  1.   

    Dim dbs As Database
    dbs.Excute "SELECT Count(*) AS aa FROM tab WHERE 性别='男'"
    dbs.Excute "SELECT Count(*) AS bb FROM tab WHERE 性别='女'"
    MsgBox "有 " & aa & "个男同志"
    MsgBox "有 " & bb & "个女同志"
      

  2.   

    我不是要从“表”里统计,是要从一个已经存在的记录集里,就是Select出来的记录集里进行再统计,我要怎么写?
      

  3.   

    这种问题也有100分啊?
    借用一下泰山的:dbs.Excute "select count(*) as aa form (SELECT * AS aa FROM tab WHERE 性别='男') q1"是不是这个意思?
      

  4.   

    select 性别,count(性别) from table1 group by 性别
      

  5.   

    select count(*) as aa form (SELECT * AS aa FROM tab WHERE 性别='男')
    by the way:
    哪有详细解释这样复杂的SQL语言的书?名称、作者、出版社、价格?
    小城买不到好书!
      

  6.   

    SELECT COUNT(*) FROM table WHERE condition