percentile_cont()
列の値の連続型分散に基づいてパーセントを計算します。
1percentile_cont(p) within group (order by expr [asc | desc])percentile_cont() は、グループ化された数値式 expr を受け入れ、指定された順序で並び替えます。順序が指定されていない場合、デフォルトの順序は昇順です。並び替えた順序でグループ内の値の (100*p)% の位置にある値を返します (null 値は無視)。
p には、0 ~ 1 の任意の実数値を指定できます。expr には「xInt」や「price」など任意の識別子を使用できますが、price/100 または ceil(distance) などの複雑な式や、2.5 などのリテラルは使用できません。
expr に正確な 100*p パーセントの位置の値がない場合、percentile_cont() は expr 内でその位置に最も近い 2 つの値から補間された値を返します。
たとえば、Mea1 に値 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] が含まれる場合、次の値が返されます。
1percentile_cont(0.25) within group (order by Mea1 asc) = 3.25
2percentile_cont(0.25) within group (order by Mea1 desc) = 9.75
3percentile_cont(0) within group (order by Mea1 asc) = 0
4percentile_cont(1) within group (order by Mea1 asc) = 13例 - 商談の下位 15% について、補間された値を表示する
各営業担当の商談の下位 15% を表示するとします。実際の商談規模を表示する必要はなく、下位 15% の「平均」規模だけを表示する必要があります。percentile_cont(.15) を使用します。
