Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iKPTb-0000hT-V0 for pgsql-general@arkaria.postgresql.org; Tue, 15 Oct 2019 16:15:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKPTa-0005iH-Nv for pgsql-general@arkaria.postgresql.org; Tue, 15 Oct 2019 16:15:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iKPTa-0005hu-6n for pgsql-general@lists.postgresql.org; Tue, 15 Oct 2019 16:15:10 +0000 Received: from srv01.teladesign.ie ([2001:41c9:1:41d::10]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iKPTX-0001JP-AW for pgsql-general@postgresql.org; Tue, 15 Oct 2019 16:15:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rodonnell.ie; s=exim; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PnlgF+XnHfsU+bdU6w6FAoeONPLOQwNCmY3VSY49QJQ=; b=MiQO/Upt1lIXRLPn1xFwRuCLHz jfdie5+uUibTLZMYbOrhbo2HyrzNT+4gQ9u9g0irk9u//orrUNN3jYJHDyyszovs8GiRhYrLnrXiF WHBSwiEH0sPVKQuZ0d46jBQbxsW/XGunGM+8hDW/63nT7aPQljl8Yhlx6RebxnU7EwOQ=; Received: from [93.107.231.214] (helo=[192.168.1.147]) by srv01.teladesign.ie with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iKPTR-0002qz-1A; Tue, 15 Oct 2019 17:15:02 +0100 Subject: Re: SELECT returnig a constant To: stan , 'PostgreSQL' References: <20191015132851.GA6232@panix.com> <1071f28a-c7a8-1b51-cd88-803a331158aa@rodonnell.ie> <20191015140108.GA6107@panix.com> From: Ray O'Donnell Message-ID: Date: Tue, 15 Oct 2019 17:15:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191015140108.GA6107@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 15/10/2019 15:01, stan wrote: > Thanks, as you can see from my SOLVED reply, I go that part figured out. > Now I am trying to figure out how to complete this. The SELECT returns more > than 1 row, and when I put that in the VALUES clause this does not work. Please reply to the list, rather than to me - reply-all should do the trick. :-) You're using cross-joins, which returns the cartesian product of the tables concerned, without any WHERE clause.... so if the tables are big you'll return a LOT of data. Ray. -- Raymond O'Donnell // Galway // Ireland ray@rodonnell.ie