mySQL GROUP BY different values as same -
i have data looks following
ping type network 24 3g telecom 23 3.5g tata 37 4g voda 48 3g tata 51 3.5g telecom 26 3g telecom 37 4g voda 48 3g voda
i want group in such way '3g' , '3.5g' make 1 group , '4g' makes group. in case 'voda' '4g'.
i trying output this
avgping type network 24 3xg telecom 23 3xg tata 37 4g voda 48 3xg voda
how can done?
assuming want use group by
, can use case
in group by
:
select (case when type in ('3g', '3.5g') '3g' else type end) nettype, count(*) data d group (case when type in ('3g', '3.5g') '3g' else type end) ;
Comments
Post a Comment