Group by list data in ionic 3

I have table


id customer_name country pincode

1 Jhon Mexico 12209

2 Ryan Mexico 12209

3 Max Sweden 12209

4 Steve Germany 12209

 

i want output like this:


    Mexico  
               Jhon, Ryan

    Sweden 
                 Max

    Germany 

               Steve

home.ts

show(){
    db.executeSql('SELECT *  from  tbl_data where coutry=?',[data.rows.item(i).country])

            .then((data) => {
              if (data.rows.length > 0) {
                alert(data.rows.length);
                for (let j = 0; j < data.rows.length; j++) {
                  this.userdata.push({
                  country:data.rows.item(j).country,
                   customername:data.rows.item(j).customername,
                 })
                 }}}

how I can group by the data like this in ionic v3

How to achieve this with Ionic v3? Any ideas?