Trying to solve the problem find that, but it is not what i need...
select distinct column1, count(column2) from table group by column1;
column1 column2
aaa type1
bbb type3
ccc type1
aaa type1
aaa type2
aaa type1
ccc type3
aaa type1
bbb type3
aaa type3
aaa type3
Expected result is:
aaa type1 = 4, type2 = 1, type3 = 2
bbb type3 = 2
ccc type1 = 1, type3 = 2