Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRFGc-0001yx-Dq for pgsql-general@arkaria.postgresql.org; Wed, 22 Apr 2020 13:18:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jRFGY-00030o-Cd for pgsql-general@arkaria.postgresql.org; Wed, 22 Apr 2020 13:18:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRFGY-00030c-3r for pgsql-general@lists.postgresql.org; Wed, 22 Apr 2020 13:18:14 +0000 Received: from smtp-zimbra.meteo.fr ([137.129.16.22] helo=celebrian1.meteo.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRFGV-0000OR-CS for pgsql-general@lists.postgresql.org; Wed, 22 Apr 2020 13:18:13 +0000 Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id 1F6FE1C2648 for ; Wed, 22 Apr 2020 15:18:10 +0200 (CEST) Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9X3TATykfnqz for ; Wed, 22 Apr 2020 15:18:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id EE9C41C2647 for ; Wed, 22 Apr 2020 15:18:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at celebrian1.meteo.fr Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9kw0XzSwiyDz for ; Wed, 22 Apr 2020 15:18:09 +0200 (CEST) Received: from zumba5.meteo.fr (zumba5 [172.31.9.201]) by celebrian1.meteo.fr (Postfix) with ESMTP id A906D1C264D for ; Wed, 22 Apr 2020 15:18:04 +0200 (CEST) Date: Wed, 22 Apr 2020 15:18:04 +0200 (CEST) From: PALAYRET Jacques To: pgsql-general@lists.postgresql.org Message-ID: <6773832.38531751.1587561484578.JavaMail.zimbra@meteo.fr> In-Reply-To: <1475252183.38304209.1587543326347.JavaMail.zimbra@meteo.fr> References: <1045753462.38287828.1587542449789.JavaMail.zimbra@meteo.fr> <1475252183.38304209.1587543326347.JavaMail.zimbra@meteo.fr> Subject: =?utf-8?Q?Re:_How_do_work_tercile,_percent?= =?utf-8?Q?ile_&_funcion_percentile=5Fcont()=C2=A0=3F?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_433e0682-ee54-49e8-bf51-505f5b6ba03c" X-Originating-IP: [172.31.9.204] X-Mailer: Zimbra 8.7.11_GA_3822 (ZimbraWebClient - FF75 (Win)/8.7.11_GA_3822) Thread-Topic: How do work tercile, percentile & funcion =?utf-8?Q?percentile=5Fcont=28=29=C2=A0=3F?= Thread-Index: rpiYfiL2vELi+siqSqL7KhdeiEpJjgTv7b2eCOVQoKk= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_433e0682-ee54-49e8-bf51-505f5b6ba03c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable With Libre Office Calc, same result than with PostgreSQL :=20 =3DCENTILE({1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;= 25;26;27;28;29;30}; 0.3333333333)=20 gives=20 10.6666666657 (and NOT 10.5)=20 I didn't think so.=20 De: "PALAYRET Jacques" =20 =C3=80: pgsql-general@lists.postgresql.org=20 Envoy=C3=A9: Mercredi 22 Avril 2020 10:15:26=20 Objet: Re: How do work tercile, percentile & funcion percentile_cont() ?=20 Of course, the same result with this table x(c1) for example :=20 SELECT c1, ntile(3) OVER(ORDER BY c1) FROM x ORDER BY c1 ;=20 c1 | ntile=20 ----+-------=20 1 | 1=20 2 | 1=20 3 | 1=20 4 | 1=20 5 | 1=20 6 | 1=20 7 | 1=20 8 | 1=20 9 | 1=20 10 | 1=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 11 | 2=20 20 | 2=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 21 | 3=20 (30 lignes)=20 SELECT percentile_cont(1./3) WITHIN GROUP (ORDER BY c1) FROM x ;=20 percentile_cont=20 ------------------=20 10.6666666666667=20 (1 ligne)=20 SELECT percentile_cont(2./3) WITHIN GROUP (ORDER BY c1) FROM x ;=20 percentile_cont=20 ------------------=20 20.3333333333333=20 (1 ligne)=20 De: "PALAYRET Jacques" =20 =C3=80: pgsql-general@lists.postgresql.org=20 Envoy=C3=A9: Mercredi 22 Avril 2020 10:00:49=20 Objet: How do work tercile, percentile & funcion percentile_cont() ?=20 Hello,=20