select distinct pclassname,id from Iproducts where pclassid between 21 and 28 或者 select pclassname,id from Iproducts where pclassid between 21 and 28 group by pclassname,id
你这样写当然没去重复啊select *, count(distinct pclassname) Iproducts where pclassid between 21 and 28 group by name
或者
select pclassname,id from Iproducts where pclassid between 21 and 28 group by pclassname,id