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 1jRAXg-0008CC-Qy for pgsql-general@arkaria.postgresql.org; Wed, 22 Apr 2020 08:15:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jRAXf-000358-P8 for pgsql-general@arkaria.postgresql.org; Wed, 22 Apr 2020 08:15:35 +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 1jRAXf-00033i-Fu for pgsql-general@lists.postgresql.org; Wed, 22 Apr 2020 08:15:35 +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 1jRAXY-0005yq-LB for pgsql-general@lists.postgresql.org; Wed, 22 Apr 2020 08:15:34 +0000 Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id 6417E1C260A for ; Wed, 22 Apr 2020 10:15:27 +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 rOP9Sj3SLykY for ; Wed, 22 Apr 2020 10:15:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id 479DA1C251B for ; Wed, 22 Apr 2020 10:15:27 +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 JvN_VSPUxj5H for ; Wed, 22 Apr 2020 10:15:27 +0200 (CEST) Received: from zumba5.meteo.fr (zumba5 [172.31.9.201]) by celebrian1.meteo.fr (Postfix) with ESMTP id 2C5711C260A for ; Wed, 22 Apr 2020 10:15:27 +0200 (CEST) Date: Wed, 22 Apr 2020 10:15:26 +0200 (CEST) From: PALAYRET Jacques To: pgsql-general@lists.postgresql.org Message-ID: <1475252183.38304209.1587543326347.JavaMail.zimbra@meteo.fr> In-Reply-To: <1045753462.38287828.1587542449789.JavaMail.zimbra@meteo.fr> References: <1045753462.38287828.1587542449789.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="=_13506ead-081c-4e3c-9d34-36056048298a" X-Originating-IP: [172.31.9.205] 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+siqSqL7KhdeiEpJjgTv7b2e List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_13506ead-081c-4e3c-9d34-36056048298a Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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