Hello I need help with a query and I hope you nice people might be able to help me.
Background:
Tables involved:
Salespeople
Events
Customers
In the events table, each event is associated with a event id as the primary key, a customer id (foreign key), salesperson id (foreign key)
What I am trying to do is determine the most frequent salesperson id for each customer, drawn from the event data, then based on that, return information about that salesperson so the resultant recordset would be like this:
customer, customer region, "main" salesperson, salesperson office location.
Also, as this is drawn from the event data, and customers may have many events, I need a
Select Top (distinct customer id) clause, but I am unsure of the context.
Any help would be much appreciated as currently I am
