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.92) (envelope-from ) id 1jEdmT-00049S-72 for pgsql-general@arkaria.postgresql.org; Wed, 18 Mar 2020 18:51:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEdmR-0004Eu-V0 for pgsql-general@arkaria.postgresql.org; Wed, 18 Mar 2020 18:51:03 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jEdmR-0004EB-Ku for pgsql-general@lists.postgresql.org; Wed, 18 Mar 2020 18:51:03 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEdmK-0004au-Sl for pgsql-general@lists.postgresql.org; Wed, 18 Mar 2020 18:51:03 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 48jJyk01CJz1ghM for ; Wed, 18 Mar 2020 14:50:53 -0400 (EDT) Received: by panix5.panix.com (Postfix, from userid 17622) id 48jJyj5sZ9zfYt; Wed, 18 Mar 2020 14:50:53 -0400 (EDT) Date: Wed, 18 Mar 2020 14:50:53 -0400 From: stan To: pgsql-general@lists.postgresql.org Subject: Join help, please Message-ID: <20200318185053.GA10351@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I am confused. given this view: AS SELECT employee.id , work_type.type , permit , work_type.overhead , work_type.descrip from permitted_work inner join employee on employee.employee_key = permitted_work.employee_key inner join work_type on work_type.work_type_key = work_type.work_type_key ; Why do I have 38475 rows, when the base table only has 855? My thinking was that the inner joins would constrain this view to the rows that exist in the base (permitted_work) table. Clearly I am misunderstanding something basic here. -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin