Using StoredProcedure you can achieve it.I think you said based on salary.
Here i am give some idea for your reference.
Declare @maxgood decimal
Declare @countgood decimal
Set @maxgood =(Select Max(Salary) from table1 where merit='good')
Set @countgood=(Select Count(*) from table1 where merit='good' and Salary=@maxgood)
Select (@maxgood/ @countgood) AS [PerofMaxGood] // You got Percentage of Maximum Good
But you told in future merit
type will be increase.
So first using temp table you get all the type of merit and then to pass one by one into the line
Select Max(Salary) from table1 where merit=@merit
If any doubt ask to me i will help you.