Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: Histogram Procedure/Function

Ethan Post

2006-03-10

Replies:

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@hotmail.com> wrote:

How about width_bucket analytical function?

©2008 dba.5341.com - Jax Systems, LLC, U.S.A.