mysql求P30、P50、P70
mysql如何求不同的百分位数
话不多说,直接上代码,示例如下:
select
round(avg(case
when ((kk*0.3 -floor(kk*0.3))>0 and r= floor(kk*0.3)+1) then d.pp
when ((kk*0.3 -floor(kk*0.3))=0 and r between floor(kk*0.3) and floor(kk*0.3)+1) then d.pp end),2) as p30,
round(avg(case
when ((kk*0.5 -floor(kk*0.5))>0 and r= floor(kk*0.5)+1) then d.pp
when ((kk*0.5 -floor(kk*0.5))=0 and r between floor(kk*0.5) and floor(kk*0.5)+1) then d.pp end),2) as p50,
round(avg(case
when ((kk*0.7 -floor(kk*0.7))>0 and r= floor(kk*0.7)+1) then d.pp
when ((kk*0.7 -floor(kk*0.7))=0 and r between floor(kk*0.7) and floor(kk*0.7)+1) then d.pp end),2) as p70
from (
select a.pp,
row_number() over (order by a.pp) as r,
sum(1) over()
from test_table a
) d
集合P={(x,y)|x+y=0},Q={(x,y)|x-y=2}则A∩B=. 数学 2020-04-27 …
已知函数Y=X^(P/Q),{P,Q是互质的整数}的图象关于Y轴对称,且在零到正无穷的区间上是减函 数学 2020-05-15 …
若P平方—4p-7=Q平方-4p-7=0,且P≠Q.试求1/P平分+1/Q平方的值.x^2-4x- 数学 2020-06-03 …
设X,Y,Z是三个随机变量,已知E(X)=E(Y)=1,E(Z)=-1;D(X)=D(Y)=D(Z 数学 2020-06-12 …
关于mathematica的Reduce函数解的问题.g[x]:=x^3+p*x+q;1.计算g( 数学 2020-07-21 …
1.若方程x2+2px-q=0(p,q是实数)没有实数根,求证:p+q小于四分之一2.为使关于x的 数学 2020-07-30 …
一道数学题(要有过程)已知集合A={x|x^2+px+q=0},B={x|qx^2+px+1=0} 数学 2020-07-30 …
已知幂函数y=x^(p/q)(p,q为整数,p/q为最简分数)的图象是双曲线,过(-1,1),(1 数学 2020-08-01 …
点P(X,Y)在坐标平面内,若X>0,Y<0,点P在()若XY0,点P在(),若X=Y,P在()若 数学 2020-08-02 …
(x+y):x=10:7,x:y=(p-q):p=2:3,p:q=a:b=3:5,a:(b-a)= 数学 2020-08-03 …