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 1pZKRl-00087J-7w for pgsql-general@arkaria.postgresql.org; Mon, 06 Mar 2023 23:40:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKRk-0000er-5W for pgsql-general@arkaria.postgresql.org; Mon, 06 Mar 2023 23:40:48 +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 1pZKRj-0000ei-RL for pgsql-general@lists.postgresql.org; Mon, 06 Mar 2023 23:40:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZKRh-00067t-SD for pgsql-general@lists.postgresql.org; Mon, 06 Mar 2023 23:40:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 326Neh943766374; Mon, 6 Mar 2023 18:40:43 -0500 From: Tom Lane To: Ben Clements cc: pgsql-general@lists.postgresql.org Subject: Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause In-reply-to: References: Comments: In-reply-to Ben Clements message dated "Mon, 06 Mar 2023 17:06:27 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3766372.1678146043.1@sss.pgh.pa.us> Date: Mon, 06 Mar 2023 18:40:43 -0500 Message-ID: <3766373.1678146043@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ben Clements writes: > As shown above, the following calculated column can bring in the city name, > even though the city name isn't in the GROUP BY: > max(city) keep (dense_rank first order by population desc) You haven't really explained what this does, let alone why it can't be implemented with existing features such as FILTER and ORDER BY. regards, tom lane