chiark / gitweb /
list age at birth of children
[familyTree.git] / familyTree / askQuestion.py
index dfa1fc71fbb53906e984d2d0e6f7b0ee1f47e008..f5cfa244551164a44f69d6fcb43f45fcb4332fda 100755 (executable)
@@ -257,6 +257,19 @@ def count_death_month(newLine):
 
         return out
 
+def count_age_at_child(newLine):
+
+       s = "select p1.bornYear - p2.bornYear as age, count(*)"\
+               +" FROM"\
+               +" parents INNER JOIN people p1"\
+               +" ON parents.ID = p1.ID"\
+               +" INNER JOIN people p2"\
+               +" ON parents.parentID = p2.ID"\
+               +" WHERE p1.bornYear <> 0 and p2.bornYear<>0"\
+               +" GROUP BY age;"
+
+       out = print_query(s,(),newLine)
+       return out
 
 def all_ancestors(personID,newLine):
        #find parents