MySql sum query -
i need mysql query following: select items in table, group them type, order them count type , sum count.
this i've done far:
select type, count(*) cnt $tbl_name group type order count(*) desc;
this gives me count each group. should add code also show total count (sum counts every group).
select * ( select type type, count(*) cnt $tbl_name group type rollup) inner_table order cnt desc;
note forst row rolled total sum.
Comments
Post a Comment