select count(*) from person where ispair = 1 and RegDate < '2009-01-01'

解决方案 »

  1.   

    select count(*)/2 from person where ispair = 1 and RegDate < '2009-01-01'
      

  2.   

    select max(t.cnt) 
    from(
         select count(1) as cnt from Person where UserSex='男' and RegDate < '2009-01-01'
         union all
         select count(1) as cnt from Person where UserSex='女' and RegDate < '2009-01-01'
        ) t
      

  3.   

    嗯 Good
    想请问一下count(1)  union all是什么意思 
      

  4.   


    count(1)和count(*)一样就是统计符合条件的记录数 union all就是合并两个结果集