Jump to: navigation, search

PostgreSQL WIDTH BUCKET

From w3cyberlearnings

Contents

Postgresql widht_bucket

Returns integer represented the bucket.

Syntax widht_bucket

  1. return the bucket to which operand would be assigned in an equidepth histogram with count buckets, in the range b1 to b2
  2. return the bucket to which operand would be assigned in an equidepth histogram with count buckets, in the range b1 to b2
width_bucket(op numeric, b1 numeric, b2 numeric, count int);

OR

width_bucket(op dp, b1 dp, b2 dp, count int)	;

Example 1

postgres=# SELECT width_bucket(19.4,0.50,10.3,5);
 width_bucket 
--------------
            6
(1 row)

Example 2


postgres=# SELECT width_bucket(19.4,0.50,10.3,13);
 width_bucket 
--------------
           14
(1 row)


Related Links



Navigation
Web
SQL
MISC
References