Where in the world are you guys getting the information that he wants to count the number of lines in a file, or get the first X lines??
He wants to extract the record containing the highest number id (column [0]) for each category (column [1]).
I see six categorys. Meaning he wants the result set to have six entries. One for each category, and it's corresponding id#. What's so hard about understanding that?
I don't have time to work out the algorithm for it right now, so you guys give it your best.
--mark
------------------