The best way to do this is to use a query similar to this one:
SELECT DISTINCT COL FROM TABLE ORDER BY COL DESC FETCH FIRST 10 ROWS ONLY;The ORDER BY clause will sort the data into descending by COL values; The FETCH FIRST 10 ROWS ONLY clause will limit your output to 10 rows only. The DISTINCT in the SELECT-list will eliminate duplicates. If you want to keep the duplicates, just remove the DISTINCT parameter.
Dig Deeper on IBM DB2 management
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.