select count(distinct a,b) from tabel1

解决方案 »

  1.   

    select count(distinct a,b) from tabel1select count(t.*) from (select distinct a,b from table1) t
      

  2.   

    --就是这样啊!
    select count(*),a,b from tabel1 group by a,b
      

  3.   

    to: aw511(点点星灯)select count(*),a,b from tabel1 group by a,b
    求出的是a,b分组后,每组的总数我要的是以a,b分组后,整个表共有多少条数据
      

  4.   

    没有必要用临时表,直接用子查询。select count(1) from (select a,b from table1 group by a,b) tselect count(1) from (select distinct a,b from table1) t