select 商品名称,count(*) ,sum(进价),sum(买价),
sum(case when 买价-进价>10 then 1 else 0 end)
from 商品表
where substr(商品名称,1,1)='A'
group by 商品名称
sum(case when 买价-进价>10 then 1 else 0 end)
from 商品表
where substr(商品名称,1,1)='A'
group by 商品名称
sum(case when 买价 - 进价 > 10 then 1 else 0 end) "大于10数量"
from tablename
where 商品名称 like 'A%'