score:2

Accepted answer
select 
    sum(case when typeofuseage = 'a' then 1 else 0 end) as typeacount
    , sum(case when typeofuseage = 'b' then 1 else 0 end) as typebcount
from mytable

score:1

            var entity=new myentity()

            entity.typeacount = data.count(a => a.typeofusage == "a"),
            entity.typebcount =data.count(b => b.typeofusage == "b")

More Query from same tag