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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Histogram Procedure/Function

Re: Histogram Procedure/Function

From: Ethan Post <post.ethan_at_gmail.com>
Date: Fri, 10 Mar 2006 22:26:17 -0600
Message-ID: <357b48a90603102026l50da25ffs84e3ebfba5092218@mail.gmail.com>


I think this will work. SQL below is just an example. Thanks!

select min(cols) min_range, max(cols) max_range, count(*) ttl from ( select cols, width_bucket(cols, 1, 400, 10) wb from ( select table_name, (select count(*) from all_tab_columns b where a.table_name=b.table_name and b.owner='X') cols   from all_tables a where owner='X')) group by wb;

 MIN_RANGE MAX_RANGE TTL
---------- ---------- ----------

         0          0          8
         1         40        895
        41         80         78
        81        119         28
       121        158         16
       166        185          3
       201        235          9
       243        259          6
       360        360          1
       389        392          2

10 rows selected.

On 3/10/06, Michael McMullen <ganstadba_at_hotmail.com> wrote:
>
>
> How about width_bucket analytical function?
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 10 2006 - 22:26:17 CST

Original text of this message

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