Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to query partitioned tables?

Re: How to query partitioned tables?

From: RK <rekaben_at_yahoo.com>
Date: 13 Feb 2004 19:16:05 -0800
Message-ID: <239f1935.0402131916.58565f96@posting.google.com>


"Ron" <support_at_dbainfopower.com> wrote in message news:<2-adnTbC698BwrDdRVn-jA_at_comcast.com>...
> Hello RK,
>
> You can do it this way:
>
> select a.cnt + b.cnt + c.cnt
> from
> ( select count(*) from tab1 partition(yesterday_name) p1 where p1.f2 =
> yesterday ) a
> ,( select count(*) from tab1 partition(today_name) p2 where p2.f2 = today )
> b
> ,( select count(*) from tab1 partition(tomorrow_name) p3 where p3.f2 =>
> tomorrow ) b
>
> As Sybrant mentioned, if you have only three partitions in a table you can
> run just one query to get count.
>
> Regards,
>
> Ron
> DBA Infopower
> http://www.dbainfopower.com
> Standard disclaimer:
> http://www.dbainfopower.com/dbaip_advice_disclaimer.html
>
>
>

Thanks.

This may be the nice solution. However what if I have more partitions to add on? I have to make a generic script to do all that?

RK Received on Fri Feb 13 2004 - 21:16:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US