Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YsC4Q-0000Kl-P8 for pgsql-sql@arkaria.postgresql.org; Tue, 12 May 2015 15:26:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YsC4Q-0005QX-2I for pgsql-sql@arkaria.postgresql.org; Tue, 12 May 2015 15:26:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YsC4P-0005QR-ER for pgsql-sql@postgresql.org; Tue, 12 May 2015 15:26:09 +0000 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YsC4M-0005o3-6Q for pgsql-sql@postgresql.org; Tue, 12 May 2015 15:26:08 +0000 Received: by oift201 with SMTP id t201so8742352oif.3 for ; Tue, 12 May 2015 08:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=Ee2NT0vu2SbnAu8GncunlUX2K0Kk7K4cGLaX9xL7GOE=; b=p7BhTeMktSgzriZvRWGgI3rNxCwqNe+YaxVJ2nXtDSRNZ5gdo9gyI7M1hf5YJNVC3e BHZt66VReRkzb0xKCcy5g8AXmXG6DJm2mzA2Qjwg5VFmg5jcRSyrWAidde3Y01Eo9HEo hC1Yjht0BFU2ARdEgsHKKrDLtKkqmPm4oDPj9ii+DY3p/nFehzWONOhwjS0YTU/mp7SR WSwT8NGgWAAOcahBjO93uOIo0rNdOsWY7VSWVvQdKdrpnC6VFGnUvRk7kxB56sJIWiAq vf54MNvfr38yuXWKvGEYAFakzHwqvkBU6/VgEDT6Mgld9uiCMAgu3JrJFlrbOu2vWnic Bs+w== X-Received: by 10.202.67.10 with SMTP id q10mr11908718oia.124.1431444364195; Tue, 12 May 2015 08:26:04 -0700 (PDT) Received: from [127.0.0.1] (mail.jonesborocwl.org. [64.233.145.118]) by mx.google.com with ESMTPSA id sm8sm11045588obb.13.2015.05.12.08.26.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 08:26:03 -0700 (PDT) Message-ID: <55521B89.1090900@gmail.com> Date: Tue, 12 May 2015 10:26:01 -0500 From: Jason Aleski User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: ERROR: column "gid" specified more than once References: <1431419471426-5848845.post@n5.nabble.com> In-Reply-To: <1431419471426-5848845.post@n5.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) 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 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