Re: Reporting by family tree

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ibrahim Shaame <ishaame(at)gmail(dot)com>
Cc: swastik Gurung <gurung_swastik(at)yahoo(dot)com>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Re: Reporting by family tree
Date: 2023-10-16 13:10:50
Message-ID: CAKFQuwYn6MfTyjpDraVqW7TfnCh2Q3-DvfEYHz+vifXvzpr_FA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Monday, October 16, 2023, Ibrahim Shaame <ishaame(at)gmail(dot)com> wrote:

> Thanks David for the reply. But I think you missed part of the code, which
> refers to ukoo:
> )
>
> SELECT g.jina AS jina_la_mtoto,
> g.baba AS baba_wa_mtoto,
> g.babu AS babu_wa_mtoto,
> g.namba,
> mzazi.jina AS jina_la_mzazi,
> mzazi.baba AS jina_la_baba_la_mzazi,
> g.daraja
> FROM ukoo g
> JOIN majina2 mzazi
> ON g.namba = mzazi.namba
> ORDER BY g.namba;
>
> Any suggestion?
>

That part of the query is outside the CTE and thus doesn’t impact the CTE’s
results. The part of the query that needs to be self-referencing is the
subquery inside the CTE under the Union All.

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message swastik Gurung 2023-10-16 13:29:32 Re: Reporting by family tree
Previous Message Ibrahim Shaame 2023-10-16 11:44:35 Re: Reporting by family tree