OK, for various reasons, I want to convert a nice relational database into a single flat table.
Currently I have a tbl_household table (with ID) and a tbl_person table (with ID) which has a parent bool value. I need a single table (ie query) which returns:
Household & person 1 (where parent == true) & Person 2 (where parant = true) & person 3 (where parent == false) & person 4 (where parent == false) & person 5 (where parent == false)
Ie the whole family in one table (a family is assumed to have no more that 2 parents, and no more than 3 children, but can have less)
I have got a version running that give me something like this, but I get 2 rows per houshold, with the parents swapped (I was doing the simpler, without kids case)
Can this be done in SQL (access) and if so how?
Currently I have a tbl_household table (with ID) and a tbl_person table (with ID) which has a parent bool value. I need a single table (ie query) which returns:
Household & person 1 (where parent == true) & Person 2 (where parant = true) & person 3 (where parent == false) & person 4 (where parent == false) & person 5 (where parent == false)
Ie the whole family in one table (a family is assumed to have no more that 2 parents, and no more than 3 children, but can have less)
I have got a version running that give me something like this, but I get 2 rows per houshold, with the parents swapped (I was doing the simpler, without kids case)
Can this be done in SQL (access) and if so how?