Select based on highest percentage value of two columns

I have a MySQl table which holds performance result data.
ASales_Actual, ASales_Target, BSales_Actual, BSales_Target, Name, Team

I need to write a select statement which will show the person who has sold the most in terms of highest percentage reached of their target. I don’t know how to do this.

I am able to select the person who has sold the most units using sum()

Can someone please help me with who I can select the highest in terms of percentage reached please?

This isn’t the entire query, but could you use something like MAX(ASales_Actual/ASales_Target) AS max_percentage?

what’s the reason for “A” and “B” columns?

thanks I’ll see if I ca make that work

There are two different types of sales figures that need to be entered individually into the table

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.