SQL query to find top 5 users having more rows/data in table
Dear experts,
OS = HP-UX
Database = Oracle 9.2.0.8
AC users = 600
Ex:-
select * from all_users where username like 'AC%';
AC_1
AC_2
AC_3
AC_4
AC_5
AC_6
AC_.
AC_.
AC_.
AC_600
Each AC user having same tables INCOMING, OUTGOING
Now i need to find top 5 users having more rows/data in INCOMING , OUTGOING tables. I tried this:
SQL>conn AC_1/pwd
select 'select count(*) from '||table_name||';' from user_tables;
But i get max counts info only for this AC_1 user , however, i need top 5 users having more rows/max counts query.
Thank you,