I am trying to find the most frequent payment amount in a sql table spanning a 12 month period for 300,000 individual accounts. Does anyone know how I would go about writing a query in SQL to return the most frequent payment and the number of times it occurs throughout the 12 month period. Each month is represented in a column such as:
Month1 Month2 month3 month4 Month5 Month6 etc etc..
120 110 120 90 120 100 ....
For this example I would like to return 120 and the count of how many times it occurs...
Is there any type of function that will help with this or does anyone know the easiest way to write a query to return this?
Thanks,
FrankW
Month1 Month2 month3 month4 Month5 Month6 etc etc..
120 110 120 90 120 100 ....
For this example I would like to return 120 and the count of how many times it occurs...
Is there any type of function that will help with this or does anyone know the easiest way to write a query to return this?
Thanks,
FrankW