Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Counting number of rows that resides in a partition/subpartiton

user588395Aug 10 2007 — edited Aug 10 2007
Hi,
I need to get the number of rows from a subpartition named (G2EDC_LOG_200704_20070407 ) in edc_log_test . Here is the below query which I am going to use to get the count of records.

Also I need to know if I can combine this query with out using UNION ALL.

Thanks in advance.
Jay

SELECT count(el.batch_nbr)
FROM edc_log_test el,
edc_batch_test eb
WHERE el.batch_nbr = eb.batch_nbr
AND eb.status IN ('SUSPENDED' ,'BALANCED' )
AND (eb.user_status = 'CLOSED'
OR eb.user_status IS NULL)
AND TO_CHAR(capture_date,'YYYYMMDD') >= sysdate - 60
AND nvl(do_not_remit, 0) <> 0
UNION ALL
SELECT count(el.batch_nbr)
FROM edc_log_test el,
edc_batch_test eb
WHERE el.batch_nbr = eb.batch_nbr
AND eb.status IN ('SUSPENDED')
AND eb.user_status IN ('NEW', 'OPEN')
AND TO_CHAR(capture_date,'YYYYMMDD') >= sysdate - 365
AND nvl(do_not_remit, 0) <> 0
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2007
Added on Aug 10 2007
12 comments
6,316 views