Query to extract greatest number

jamphan

Registered User.
Local time
Today, 15:36
Joined
Dec 28, 2004
Messages
143
I have a table that keeps track of how many times an account is listed. I want to write a query that will only return the greatest number of occurences for that account. For example if acct 12345 has 3 occurences in the database I only want to return the information that is associated with the #3 occurence. As stated there is a field that calculates the number of occurences for each account so in this case there would be a record for 1, 2, and 3 occurence so I only want to see #3. Hope that makes sense. Thanks!
 
Why number three. If you do not sort on anthing other than the account number then 3rd occurence may change each time you run the query.
 
I am not looking specifically for the number 3. I am looking for the highest number associated with any account. Could be a 1, could be a 6.
 
I figured it out. I can use the Max function on the number of occurences field
 

Users who are viewing this thread

Back
Top Bottom