agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Jason Aleski <jason.aleski@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: ERROR: column "gid" specified more than once
Date: Tue, 12 May 2015 10:26:01 -0500
Message-ID: <55521B89.1090900@gmail.com> (raw)
In-Reply-To: <1431419471426-5848845.post@n5.nabble.com>
References: <1431419471426-5848845.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

You probably need to specify your wildcard on both tables.

CREATE TABLE "BorujerdDistCent" as
SELECT
   "Borujerd".*, "Lorestan".*, t_distance(st_centroid("Lorestan".geometry),"Borujerd".geometry)/1000
as DistFromCntroid
FROM "Borujerd", "Lorestan"
Where "Lorestan"."Shahrestan" = 'بروجرد'
ORDER BY
   "Borujerd".abady_name ASC






Jason Aleski / IT Specialist

On 5/12/2015 3:31 AM, BahramPSQL 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
>
>
>
> --
> View this message in context: http://postgresql.nabble.com/ERROR-column-gid-specified-more-than-once-tp5848845.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (8+ messages)  latest in thread

Message-ID: <55521B89.1090900@gmail.com>
Permalink:  ../55521B89.1090900@gmail.com/
Also on:    postgresql.org/message-id/55521B89.1090900@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jason.aleski@gmail.com
  Subject: Re: ERROR: column "gid" specified more than once
  In-Reply-To: <55521B89.1090900@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox