Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drk2r-0007Dp-48 for pgsql-sql@arkaria.postgresql.org; Tue, 12 Sep 2017 12:12:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drk2p-0004zv-D2 for pgsql-sql@arkaria.postgresql.org; Tue, 12 Sep 2017 12:11:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drk1q-0003C1-Kd for pgsql-sql@postgresql.org; Tue, 12 Sep 2017 12:10:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drk1n-0006S3-2d for pgsql-sql@postgresql.org; Tue, 12 Sep 2017 12:10:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8CCAoFs031483; Tue, 12 Sep 2017 08:10:51 -0400 From: Tom Lane To: =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= cc: pgsql-sql@postgresql.org Subject: Re: FirebirdSQL to PostgreSQL In-reply-to: <000401d32bba$b83ca550$28b5eff0$@1nar.com.tr> References: <000401d32bba$b83ca550$28b5eff0$@1nar.com.tr> Comments: In-reply-to =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= message dated "Tue, 12 Sep 2017 14:31:47 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <31481.1505218250.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 12 Sep 2017 08:10:50 -0400 Message-ID: <31482.1505218250@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= writes: > I have below sql running fine on FirebirdSQL but not on PostgreSQL. As I am > not the editor of the SQL, I cannot fix it to work with PostgreSQL. Any help > is appreciated. You're not being consistent about quoting, e.g. you've got this > COALESCE(DT.IAIK_OG, 0) AS "IAIK_OG", which seems to be trying to reference this field of the DT subselect: > (sum(M.TES_IMARALANICIOG)/(select sum(I.ILC_IMARALANICI_OG) from > ILCELER_TABLOSU I where I.ILCEADI = 'CÝHANBEYLÝ')*60) as "IAIK_OG", but it won't match because IAIK_OG is not the same name as "IAIK_OG". (According to Postgres --- some other systems treat this differently.) Best rule is to always quote a particular name or never quote it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql