Re: ERROR: column "gid" specified more than once

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: BahramPSQL <bahramjomezade(dot)gis92(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: ERROR: column "gid" specified more than once
Date: 2015-05-12 15:07:23
Message-ID: CAKFQuwbVVDDjxPve410YZiFOAOMhM8mmsfK1zcmAp7=zoRTzpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, May 12, 2015, BahramPSQL <bahramjomezade(dot)gis92(at)gmail(dot)com> wrote:

> I want to run a spatial query from two table!
>
> CREATE TABLE "BorujerdDistCent" as
> SELECT
> *, st_distance(st_centroid("Lorestan".geometry),"Borujerd".geometry)/1000
> as DistFromCntroid
> FROM "Borujerd", "Lorestan"
> Where "Lorestan"."Shahrestan" = 'بروجرد'
> ORDER BY
> "Borujerd".abady_name ASC
>
> But i will see this error!
> ERROR: column "gid" specified more than once
> ********** Error **********
>
> ERROR: column "gid" specified more than once
> SQL state: 42701
>
>
This is not a bug. You need to rewrite the query to avoid two output
columns named "gid".

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Aleski 2015-05-12 15:26:01 Re: ERROR: column "gid" specified more than once
Previous Message BahramPSQL 2015-05-12 08:31:11 ERROR: column "gid" specified more than once