1
I need to make a query that returns the 3 highest salaries of civil servants, per state. example that should return:
fulano 850 RJ
ciclano 800 RJ
beltrano 700 RJ
joao 1000 SP
maria 900 SP
pedro 200 SP
I used MAX
in salary and Group by state, however, appears only the highest wages of each state.
If anyone knows, please help me.
Group by Funcionario, Estado
have you tried? This one of mine question is very similar to what you want but then I answered using theMin
– Marconi
Check this link, this might help: http://stackoverflow.com/questions/4775820/sql-give-me-3-hits-for-each-type-only
– Bruno Mangini Alves
Camila, post your table and the query you tried please.
– Anthony Accioly