On Monday, October 16, 2023, Ibrahim Shaame <
ishaame@gmail.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.