select *,(select count(*) from t where 性别='男' ) as counts
from t
where 性别='男'

解决方案 »

  1.   

    select (select count(*) from t where 性别='男' ) as counts
    from t where 性别='男'
      

  2.   

    怀疑 ykily(老实人) 是马甲
      

  3.   

    select *,(select count(*) from t where 性别='男' ) as counts
    from t
    where 性别='男'同意
      

  4.   

    怀疑 ykily(老实人) 是马甲
    -------------------------
    ???
    在CSDN也不是一天半天了,虽说水平没怎么见长,好歹多少还算懂点规矩,怎么我成了马甲了???
    晕哦~~~~~~~~~
    你说我是谁的马甲???
    : (
      

  5.   

    select *,(select count(*) from 表名 where 性别='男' ) as counts from 表名 where 性别='男'