I have a table that I was able to cout the number of rows e.g
select count(*) from emp
This emp table has been partitioned on the sal column into months. Each partition on the sal column
My question is how do I count the number of rows from each partition? Is that possible?
If so how? Can anybody do an example?
01-31-2001, 12:36 PM
select count(*) from emp partition (sal_jan2000) will get the info from one partition.
01-31-2001, 12:41 PM
select count(*) from emp partition (sal_jan2000 )
01-31-2001, 03:40 PM
Thanks for the prompt reply.
I tried the earlier suggested method to this particular scenario below but it did not work.
Below is the exact scenario:
I have a table called SALES and it has been altered and partitions have been added to it. This is the way it was altered to add the partitions like I have below:
alter table sales
add partition jan_2000 values less than ('01-feb-2000')
How do I count all the rows in jan_2000 partition using select count(*)?
01-31-2001, 04:17 PM
>I tried the earlier suggested method to this particular >scenario below but it did not work.
How it did not worked: some Oracle version does not support this syntax or has bugs (version 815 hasthe syntax. As for bugs, there are some, like CBO and RULE based optimizer modes returns different number of rows.)
02-01-2001, 08:53 AM
Okay lets start again assuming I never asked the previous question.
This is the query that I got when I selected table_name, Partition_name, tablespace_name from dba_tab_partition