> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Tom Lane
> Sent: Tuesday, September 12, 2017 3:11 PM
> To: Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] FirebirdSQL to PostgreSQL
>
> Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr> 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
ornever quote it.
>
> regards, tom lane
Thanks you Tom.
That was it. For now, I simply removed all quotes and query executed just fine.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql