Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIJy8-0000Ph-W7 for pgsql-general@arkaria.postgresql.org; Thu, 01 Nov 2018 20:53:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIJy5-0002bj-Tf for pgsql-general@arkaria.postgresql.org; Thu, 01 Nov 2018 20:53:29 +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.89) (envelope-from ) id 1gIJy5-0002bW-LB for pgsql-general@lists.postgresql.org; Thu, 01 Nov 2018 20:53:29 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIJy3-0002uA-Jm for pgsql-general@postgresql.org; Thu, 01 Nov 2018 20:53:29 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 86636992D5 for ; Thu, 1 Nov 2018 13:53:25 -0700 (PDT) Date: Thu, 1 Nov 2018 13:53:25 -0700 (PDT) From: Rich Shepard To: pgsql-general Subject: Re: Add columns to table; insert values based on row In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 1 Nov 2018, David G. Johnston wrote: > That makes no sense to me...you already have 82 rows on the table so if you > insert 82 more you'll have 164 which doesn't seem like what you would > want... > > I would probably do: David, The table already exists with four attribute columns and their data. I'm adding four new columns and their data base on the existing row's value in column site_nbr. Based on your and Adrian's responses I'll go ahead and enter the values filled intert statements for each row. Thanks, Rich