Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Histogram Procedure/Function
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-lReceived on Fri Mar 10 2006 - 22:26:17 CST
![]() |
![]() |