Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elcBm-0002cU-O2 for pgsql-admin@arkaria.postgresql.org; Tue, 13 Feb 2018 15:08:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elcBl-0000q1-BW for pgsql-admin@arkaria.postgresql.org; Tue, 13 Feb 2018 15:08:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elcBk-0000pr-Pd for pgsql-admin@lists.postgresql.org; Tue, 13 Feb 2018 15:08:09 +0000 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1elcBh-0005q9-VH for pgsql-admin@postgresql.org; Tue, 13 Feb 2018 15:08:07 +0000 Received: by mail-wr0-x229.google.com with SMTP id 34so8674244wre.13 for ; Tue, 13 Feb 2018 07:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:subject:date:mime-version:thread-index :content-language; bh=PtdJ/julqP4oKmpgoTP0DV+6JvIvJ3AaMg2+OdA4UBw=; b=dCQkLc8eS8jlHAXSKhFW3Zy3o2Ol4rTwm/YO1dZWD68rOKYx/sx6riMpuPQGdTtqza RsxZtQ6TpomnDgDtRkvj3pUk0e/Wur1Xhnw4RQWZ8szkm4rAsvmQt6t6VRk2S4wbGInj HIbEdgXvH8sm+drcZAcOW4mn6dr0+NhnqzV57mAKl7IKJmt3410OBY0mxWJcy3cigDez iY6j46qYUAObY2xmSetvRrJCUSTO+dmte7NsR7D2Kz7eol75p9WCtxjYY3/OsOWPgitn v090OVMxticgLYsZq4VXhSyAGMTWgtwLruZDLyNIEBq59wM6bcZaDg23SAOO39ILYE+U 9DtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:subject:date:mime-version :thread-index:content-language; bh=PtdJ/julqP4oKmpgoTP0DV+6JvIvJ3AaMg2+OdA4UBw=; b=GT4qwwuk30JsgOL1XRrKZ9q8VUyuGfD4C2SAeR3SZY4qSoOz7y8tohaT3izIAfK2zI e5FxfHWjqU2sx8/RDeOTPLO83ywkovHfLno1CNZQUretX9IVibxTh498NHeuXEfpXDNa tmZNR5IGmN5OTCQi3qrPtk9CUFxcS8Vtv2nTnMvEswNGAFin+eXvSaiEatBQl8DCxLK1 5UsTSKtg3FKDUFk3Essgumqr0Y/Ak82Ae420b+598hgsmsZv8AF0B3EPAfhevm9WAjnQ IGHtWxRLhwM0Kr3pk6YiRlU1Mqe8dryp9aeU9kc6/NJsd5P7CuBTJCIM67zKcMv1PEBw uOKA== X-Gm-Message-State: APf1xPBAxDZ5mOSaMe+0Qx0YSjHEqkVQhaHLWnZwJLmYFd5edJBE3khM rY6j4GFt6vGAojFlmsiBuGD2Vw== X-Google-Smtp-Source: AH8x226qPA9nwKupyHk2q6xuVjZMbUYGUqAB8grahESVZ3+dNVMC/qQ4JB3ROceydQto7FamiA0hCQ== X-Received: by 10.223.190.143 with SMTP id i15mr1590041wrh.145.1518534482845; Tue, 13 Feb 2018 07:08:02 -0800 (PST) Received: from PADOUE (mau78-1-88-184-109-217.fbx.proxad.net. [88.184.109.217]) by smtp.gmail.com with ESMTPSA id 137sm8289650wmm.46.2018.02.13.07.08.01 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Feb 2018 07:08:01 -0800 (PST) Message-ID: <5a82ff51.8f0c1c0a.ffaa0.df34@mx.google.com> X-Google-Original-Message-ID: <00ef01d3a4dc$6fc1ab40$4f4501c0$@lepretre@gmail.com> From: =?iso-8859-1?Q?Olivier_Lepr=EAtre?= To: "'pgsql-admin'" Subject: filter partitions Date: Tue, 13 Feb 2018 16:07:58 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00F0_01D3A4E4.D1861340" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdOk3G42QPnkfI7RTEePT5a7pzxciA== Content-Language: fr X-Antivirus: Avast (VPS 180213-0, 13/02/2018), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_00F0_01D3A4E4.D1861340 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I wonder how could it be possible to extract partitions that contains a peculiar item Consider 4 partitions 1, 2, 3, 4 with different items A, B, C... inside P item 1 A 1 B 1 C 2 B 2 D 2 G 2 H 3 B 3 C 4 X 4 D 4 Z How could a select return partitions 2,4 because they both contains D item = ? As a result, I would get : 2 B 2 D 2 G 2 H 4 X 4 D 4 Z I can filter partitions with lag, lead, nth_value... but how could I write something like "select P,any (item=3DD) over (partition by P) from..." Thanks for any help, --- L'absence de virus dans ce courrier =E9lectronique a =E9t=E9 v=E9rifi=E9e p= ar le logiciel antivirus Avast. https://www.avast.com/antivirus ------=_NextPart_000_00F0_01D3A4E4.D1861340 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,

 

I wonder how could it be possible to extract partitions= that contains a peculiar item

<= span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Verdana","sans-ser= if"'> 

Consider 4 part= itions 1, 2, 3, 4 with different items A, B, C... inside<= /p>

 

P item

1 A

1 B

1 C

2 B<= o:p>

2 D

2 G

2 H

3 B=

3 C

4 X

4 D<= o:p>

4 Z

 

 

How could a= select return partitions 2,4 because they both contains D item ?

 

As a result, I would get :

 

2= B

2 D

2 G

<= span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Verdana","sans-ser= if"'>2 H

4 X

4 D

4 Z

 <= /o:p>

I can filter partitions with lag= , lead, nth_value... but how could I write something like "select P,an= y (item=3DD) over (partition by P) from..."

 

Thanks for any help,

 

 =

3D"" Garant= i sans virus. www.avast.com
=
------=_NextPart_000_00F0_01D3A4E4.D1861340--