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 1nyioL-0007oC-Aw for pgsql-sql@arkaria.postgresql.org; Tue, 07 Jun 2022 23:40:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nyioK-0006Os-7V for pgsql-sql@arkaria.postgresql.org; Tue, 07 Jun 2022 23:40:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyioJ-0006Oh-V7 for pgsql-sql@lists.postgresql.org; Tue, 07 Jun 2022 23:40:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyioH-0006vh-Ob for pgsql-sql@lists.postgresql.org; Tue, 07 Jun 2022 23:40:30 +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 257NeQ6v1432227; Tue, 7 Jun 2022 19:40:26 -0400 From: Tom Lane To: Rein Petersen cc: pgsql-sql@lists.postgresql.org Subject: Re: losing my mind about sytnax error in window clause In-reply-to: References: Comments: In-reply-to Rein Petersen message dated "Tue, 07 Jun 2022 18:03:42 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1432225.1654645226.1@sss.pgh.pa.us> Date: Tue, 07 Jun 2022 19:40:26 -0400 Message-ID: <1432226.1654645226@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rein Petersen writes: > ERROR: syntax error at or near "BY" > LINE 16: WINDOW w AS ( PARITION BY locationid, partindex ORDER BY cr... > ^ If you really spelled it like that, "PARTITION BY" should work better. regards, tom lane