View Single Post
  #1 (permalink)  
Old April 8th, 2004, 05:10 AM
Ben Ben is offline
Authorized User
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stuck with Select Query...

I have a table that contains like the following:

EmployeeName, Reason

I need to count the occurences of each reason for each employee and select the reason that occurs the maximum number of times.
I thought about doing a nested Select query, but I can only get this to return the employee with their reason that occured the maximum number of times

Joe Bloggs, Credit Authorised

I can't seem to get the query to return each employee with their reason that occurred for them the maximum number of times.

A N Other, Enquiry
Joe Bloggs, Credit Authorised
John Doe, Escalated Call
S O Else, Credit Authorised

Thanks in advance