0

鉴于下面给出的单表设计,如何最好地查询以下内容

  • 给定一个民间 id 的大家庭成员的集合
  • 给定两个民间 id 的一组共同祖先
  • 给定民间 id 的后代集

*奖金1st cousins,两次删除给一个民间 id

餐桌民俗

FolkID (PK)
MotherID (FK to folkid)
FatherID (FK to folkid)
Name
Gender
4

1 回答 1

1

有人必须建立一个家谱应用程序?前段时间我做了类似的事情,使用 XML 和 XPath:

<Persons>
     <Person ID="1" Name="Minu eesnimi" Surname="Minu perekonnanimi" Picture="0" Sex="M">
          <Event Name="Birth" Prefix="" Location="Tallinn" Date="14.01.1963"><![CDATA["Ilusal jaanuarihommikul"]]>
          </Event>
          <Event Name="Death" Prefix="" Location="" Date=""/>
          <Father ID="2" Type="P&#228;ris"/>
          <Mother ID="3" Type="P&#228;ris"/>
          <Spouse ID="4"/>
        </Person>
...

String XPath="child::*/child::Person[child::Father[@ID=\""+String(ID) +"\"] 和 child::Mother[@ID=\""+String(配偶)+"\"]]"; 等等

于 2009-01-26T22:06:29.460 回答