Re: Reporting by family tree
swastik Gurung <gurung_swastik@yahoo.com>
From: swastik Gurung <gurung_swastik@yahoo.com>
To: "pgsql-novice@lists.postgresql.org" <pgsql-novice@lists.postgresql.org>, Ibrahim Shaame <ishaame@gmail.com>
Date: 2023-10-05T13:15:07Z
Lists: pgsql-novice
I suppose you ought to be using, recursive CTE queries
Documentation can be found at: 7.8. WITH Queries (Common Table Expressions)
|
|
|
| | |
|
|
|
| |
7.8. WITH Queries (Common Table Expressions)
7.8. WITH Queries (Common Table Expressions) # 7.8.1. SELECT in WITH 7.8.2. Recursive Queries 7.8.3. Common Tabl...
|
|
|
On Thursday, 5 October 2023 at 16:44:46 GMT+5:45, Ibrahim Shaame <ishaame@gmail.com> wrote:
I have a table of members of alarge family extendending back to eight generations. The currentmembers contribute a monthly amount to the family fund. Only truedescendants are included in the family list, no wives, no husbands.There are two tables
1- Names with the following fields: idno (unique) --family member
parentid -- id number of the parent who connected the child to the family
etc
etc
2– Contributions with fields: idno
etc
etc
NowI want to report Names and contributions par family tree: My ideal isto list grandfather, father, children based on the two fields (id,parentid).
Any suggestions?
Thanks in advance