"use strict";(self.webpackChunkdoris_website=self.webpackChunkdoris_website||[]).push([[81324],{15680:(e,t,n)=>{n.d(t,{xA:()=>u,yg:()=>g});var r=n(296540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},y=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,c=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),p=s(n),y=a,g=p["".concat(c,".").concat(y)]||p[y]||f[y]||l;return n?r.createElement(g,i(i({ref:t},u),{},{components:n})):r.createElement(g,i({ref:t},u))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,i=new Array(l);i[0]=y;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o[p]="string"==typeof e?e:a,i[1]=o;for(var s=2;s<l;s++)i[s]=n[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}y.displayName="MDXCreateElement"},751958:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>f,frontMatter:()=>l,metadata:()=>o,toc:()=>s});var r=n(58168),a=(n(296540),n(15680));const l={title:"PERCENTILE_ARRAY",language:"en"},i=void 0,o={unversionedId:"sql-manual/sql-functions/aggregate-functions/percentile-array",id:"sql-manual/sql-functions/aggregate-functions/percentile-array",title:"PERCENTILE_ARRAY",description:"\x3c!--",source:"@site/docs/sql-manual/sql-functions/aggregate-functions/percentile-array.md",sourceDirName:"sql-manual/sql-functions/aggregate-functions",slug:"/sql-manual/sql-functions/aggregate-functions/percentile-array",permalink:"/docs/dev/sql-manual/sql-functions/aggregate-functions/percentile-array",draft:!1,tags:[],version:"current",frontMatter:{title:"PERCENTILE_ARRAY",language:"en"},sidebar:"docs",previous:{title:"PERCENTILE",permalink:"/docs/dev/sql-manual/sql-functions/aggregate-functions/percentile"},next:{title:"PERCENTILE_APPROX",permalink:"/docs/dev/sql-manual/sql-functions/aggregate-functions/percentile-approx"}},c={},s=[{value:"PERCENTILE_ARRAY",id:"percentile_array",level:2},{value:"Description",id:"description",level:3},{value:"Syntax",id:"syntax",level:4},{value:"example",id:"example",level:3},{value:"keywords",id:"keywords",level:3}],u={toc:s},p="wrapper";function f(e){let{components:t,...n}=e;return(0,a.yg)(p,(0,r.A)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h2",{id:"percentile_array"},"PERCENTILE_ARRAY"),(0,a.yg)("h3",{id:"description"},"Description"),(0,a.yg)("h4",{id:"syntax"},"Syntax"),(0,a.yg)("p",null,(0,a.yg)("inlineCode",{parentName:"p"},"ARRAY_DOUBLE PERCENTILE_ARRAY(BIGINT, ARRAY_DOUBLE p)")),(0,a.yg)("p",null,"Calculate exact percentiles, suitable for small data volumes. Sorts the specified column in descending order first, then takes the exact pth percentile.\nThe return value is the result of sequentially taking the specified percentages in the array p.\nParameter Description:\nexpr: Required. Columns whose values are of type integer (up to bigint).\np: The exact percentile is required, an array of constants, taking the value ","[0.0, 1.0]","."),(0,a.yg)("h3",{id:"example"},"example"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"mysql> select percentile_array(k1,[0.3,0.5,0.9]) from baseall;\n+----------------------------------------------+\n| percentile_array(`k1`, ARRAY(0.3, 0.5, 0.9)) |\n+----------------------------------------------+\n| [5.2, 8, 13.6] |\n+----------------------------------------------+\n1 row in set (0.02 sec)\n\n")),(0,a.yg)("h3",{id:"keywords"},"keywords"),(0,a.yg)("p",null,"PERCENTILE_ARRAY"))}f.isMDXComponent=!0}}]); |