select sum(名称) from 产品表
group by  类别

解决方案 »

  1.   

    select count(*) from (select distinct 名称 from 产品表) a
      

  2.   

    不好意思我写错了
    select count(名称) from 产品表
    group by  类别
      

  3.   

    select count(distinct 名称) ,类别 from 产品表
    group by  类别
      

  4.   

    select count(名称),类别 from 产品表 group by 类别
      

  5.   

    select 数量=count(名称),名称 from 产品表 group by 名称
      

  6.   

    select 类别,count(*) from (select distinct 名称,类别 from 产品表) aa
    group by 类别
      

  7.   

    select count(*) from
    (select 名称 from 产品表 where 类别 = :类别 
    group by 名称)aaa
      

  8.   

    select 类别,count(*) 产品数 from 
    (select 类别,名称 from 产品表 
    group by 类别,产品)aaa
    group by 类别