find popular data in MySQL database
Posted: Fri Mar 18, 2011 3:48 am
I am trying to write a report for some helpdesk software I am using at work...
What I want to do is find the five most used (sub)categories (each service request (or 'sr') has a category and subcategory)
to do this, I would need to query the 'category' table for the category AND subcategory. I would then check the 'sr' table for the category and subcategory used in each row...
I assume that there would be an easier way than checking what cat/subcat is used for each sr, adding these together, then working out the top five from there, but have no idea how it would work!
Does this even make sense to you? If so, please help! If not, tell me and I'll try to clarify!
What I want to do is find the five most used (sub)categories (each service request (or 'sr') has a category and subcategory)
to do this, I would need to query the 'category' table for the category AND subcategory. I would then check the 'sr' table for the category and subcategory used in each row...
I assume that there would be an easier way than checking what cat/subcat is used for each sr, adding these together, then working out the top five from there, but have no idea how it would work!
Does this even make sense to you? If so, please help! If not, tell me and I'll try to clarify!