histogram function with actual bucket boundary
Hi,
Is there anyway to get histogram function with actual bucket boundary? I have a query like this.
SELECT row_size, Count(*) frequency FROM (
SELECT WIDTH_BUCKET (Nvl(VSize(table_name),0)+1,0,30,3) row_size
FROM user_tables
) GROUP BY row_size ORDER BY row_size
ROW_SIZE FREQUENCY
1 110
2 6
But I would rather the result set to be
ROW_SIZE FREQUENCY
20 110
30 6
I know the following can do it.
SELECT row_size, Count(*) frequency FROM (
SELECT 10 * Round((Nvl(VSize(table_name),0)+1)/ 20)+20 row_size
FROM user_tables
) GROUP BY row_size ORDER BY row_size
However, I would like to have a oracle built-in function to achieve the same. Any input?
Is there anyway to get histogram function with actual bucket boundary? I have a query like this.
SELECT row_size, Count(*) frequency FROM (
SELECT WIDTH_BUCKET (Nvl(VSize(table_name),0)+1,0,30,3) row_size
FROM user_tables
) GROUP BY row_size ORDER BY row_size
ROW_SIZE FREQUENCY
1 110
2 6
But I would rather the result set to be
ROW_SIZE FREQUENCY
20 110
30 6
I know the following can do it.
SELECT row_size, Count(*) frequency FROM (
SELECT 10 * Round((Nvl(VSize(table_name),0)+1)/ 20)+20 row_size
FROM user_tables
) GROUP BY row_size ORDER BY row_size
However, I would like to have a oracle built-in function to achieve the same. Any input?
0