Depending on what "show" means, one option is to simply display it on the screen.
Example is based on Scott's sample schema, its EMP table. CLERK and SALESMAN are the most frequent jobs, so - you'd want to display them both.
SQL> set serveroutput on
SQL> select job, count(*) cnt
2 from emp
3 group by job
4 order by cnt desc;
JOB CNT
--------- ----------
CLERK 4
SALESMAN 4
MANAGER 3
ANALYST 2
PRESIDENT 1
Here's how:
- inline view (lines #6 - 10) uses
RANK analytic function which ... well, ranks jobs by their occurrence
listagg function aggregates them (i.e. "concatenates" values)
- the result is stored into a locally declared variable which is displayed using
dbms_output.put_line
SQL> declare
2 l_list varchar2(100);
3 begin
4 select listagg(job, ', ') within group (order by null)
5 into l_list
6 from (select job,
7 rank() Over (order by count(*) desc) rn
8 from emp
9 group by job
10 ) x
11 where x.rn = 1;
12
13 dbms_output.put_Line(l_list);
14 end;
15 /
CLERK, SALESMAN
PL/SQL procedure successfully completed.
SQL>