Do select searching for the 3 highest values

3

I have a table that has the following data:

  

id_indication, id_user, lg_client

A user can indicate multiple clients (lg_client = 1) , would like a select that searches the 3 users who indicated the most, ie the three id_user that they have more lg_client = 1 .

    
asked by anonymous 31.12.2015 / 11:17

1 answer

3

Make sure this solves your problem

select * from TABELA order by lg_cliente DESC LIMIT 3
    
31.12.2015 / 11:25