Hello Experts,
I have a table that contains information as follows:
SalesID, NumbSales, SalesDate
So: if salesman X sells 23 widgets on thursday, 30 widgets on friday, and 50 on Saturday
if salesman Y sell 14 widgets on Thursday, 33 widgets on friday and 42 widgets on saturday
my table looks like this:
rwid SalesID NumbSales SalesDate
10 | 1 | 23 | '2012-07-06'|
11 | 2 | 14 | '2012-07-06'|
12 | 1 | 30 | '2012-07-07'|
13 | 2 | 33 | '2012-07-07'|
14 | 1 | 50 | '2012-07-08'|
15 | 2 | 42 | '2012-07-08'|
How can I get the salesmans ID who had the max sales for the day?
So I get:
10 | 1 | 23 | '2012-07-06'|
13 | 2 | 33 | '2012-07-07'|
14 | 1 | 50 | '2012-07-08'|
Thank you in advance!
-Fox
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.