me for a20 col partition_name for a20 col subpartition_name for a20 col high_value for a15 set pagesize 1000 select table_name, partition_name, subpartition_name, high_value from user_tab_subpartitions where table_name = 'SASH_ALL'; set termout off set linesize 180 set feedback off set echo off spool partcount.sql prompt set heading off select 'select count(*),'|| ''''||partition_name||''''||' partition '|| ','''||subpartition_name||''''|| ' sub_partition ' || ' from '|| table_name|| ' subpartition('|| subpartition_name|| ');' from user_tab_subpartitions where table_name = 'SASH_ALL' / prompt set heading on spool off set pagesize 40 set linesize 80 set termout on @partcount set feedback on