Hey there, I need help with a query. The typical situation is like this:
I expect, say, 1000 rows out of a query that is based, say, on lastName column. One column is, say, firstName. I know I only have like twenty unique names that occur on multiple rows. I need to retrieve the five most frequent firstName-s in the 1000 row query result. can someone please guide me with this?
SELECT firstName FROM someTable WHERE lastName [meets some criteria] _______(what would allow me to retrieve the five most frequent firstName-s)
Any help greatly appreciated.