Don't ask to ask, just ask | |
PerlMonks |
Re: Counting events and getting top 5 matchesby jonadab (Parson) |
on Sep 17, 2008 at 11:14 UTC ( [id://711961]=note: print w/replies, xml ) | Need Help?? |
I need to do two things: 1) get the number of occurrences of each code 2) get the top 5 username/userid pair for each of these code My SQL isn't up to that sort of processing (I mostly just use SQL for data _retrieval_), so I'm going to go for a Perl answer. I assume you are using DBI and already have a connection to the database in question; I'm going to call the DBI connection $db for lack of a better name.
If you have trouble understanding how any of this code works, just ask about the part you have trouble with, and someone will explain it. This feels like a business problem to me, but on the off chance that it is actually homework, note that your professor will certainly be able to tell you didn't write the above code if you just copy it verbatim. It contains several Perl idioms that a beginning student would not have written. --
We're working on a six-year set of freely redistributable Vacation Bible School materials.
In Section
Seekers of Perl Wisdom
|
|