Join help, please

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Join help, please
Date: 2020-03-18 18:50:53
Message-ID: 20200318185053.GA10351@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-03-18 18:55:25 Re: Join help, please
Previous Message Michael Lewis 2020-03-18 18:40:03 Re: Fwd: PG12 autovac issues