Re: Histogram Procedure/Function

  • From: "Ethan Post" <post.ethan@xxxxxxxxx>
  • To: "Michael McMullen" <ganstadba@xxxxxxxxxxx>
  • Date: Fri, 10 Mar 2006 22:26:17 -0600

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@xxxxxxxxxxx> wrote:
>
>
> How about width_bucket analytical function?
>

Other related posts: