How can I make visualization with GROUP BY

I just want to exactly this query

select a ,count(a) from table group by b ;

just want to show a result that a, count a but distinct duplicate b.

It can be bar or anything

plz let me know how can i distinct column b with showing result a.

Most likely you are looking for the Terms aggregation in ES/Kibana terminology. In screenshot below, a=response, b=city_name