Selecting highest number within grouping

  • Thread starter Thread starter JMR
  • Start date Start date
J

JMR

I have a table of sales containing OrderNum, Salesman and SalesValue.Some
sales are split between two salesmen - one of the salesmen always gets a
bigger SalesValue. That salesman gets a bonus. I need to find out which of
the two salesmen has the bigger SalesValue for any given sale to calculate
the bonus.
Example 1
OrderNum Salesman SalesVaue
1001 12 1000
1001 13 500.
1002 12 500
1002 13 1000

I need to create a query that lists only the Salesman who has the greatest
SalesValue for each sale.
Example 2
OrderNum Salesman SalesValue
1001 12 1000
1002 13 1000


I don't have a clue as to how to start this. Does anyone have advice or a
reference for such a request?\

Thanks in advance,
JMR
 
Back
Top